Download Source Code

rulib - General purpose library



A C++ library for the Windows platform containing general purpose classes for files, images, sockets, registry, video capture, MIME, and other basic purposes.


Unfortunately, MS didn't make using the Socket 2 interface very straight forward. You have to disable the original socket interface by including the following line of code before you include Windows.h.

    // Turn off socket 1 interface
    #define _MSWSOCK_

Then include the Windows Socket 2 interface using something to the effecto of the following.

    #include <WinSock2.h>
    #pragma comment( lib, "WS2_32.lib" )

I usually stick this in my StdAfx.h file. To see an example, check the StdAfx.h file in rulib.h.

Folder Structure

The following example folder structure is assumed. You may need to make modifications if your structure does not match. If the folder is not mentioned, it's location (probably) won't matter.

  • code
    • lib
      • CxImage
      • jpeg
      • libpng
      • OpenCV
      • rulib
        • dox
          • doxygen.cfg

  • MyApps ( or other catagory )
    • 2005_06 ( or appropriate date)
      • App1
        • App1.dsw
      • App2
        • App2.dsw

Linking to your project

  • It is recommended you add something to the following to your projects main header or StdAfx.h file. If your application path does not match the above, you will need to modify the paths in the code section below

    #include "../../../lib/rulib/inc/rulib.h"

    #ifdef _DEBUG
    #pragma comment( lib, "../../../lib/rulib/lib/db_rulib.lib" )
    #pragma comment( lib, "../../../lib/rulib/lib/rulib.lib" )

  • You could also add the rulib folder to your include path. Manually add the libs, and add something to the effect of this to your headers.

    #include "rulib.h"  

Compiling this library.

To compile this library you will need the following

  • Microsoft Developer Studio Visual C++ 6 Service Pack 6 or better


Useful Tools

Copyright Robert Umbehant
This documentation is covered by the LGPL