Currently viewing: GipsySoft » Front Page» Articles


Wrapper class that allows exception safe and convienient calls to LoadLibray. Calls FreeLibrary when it goes out of scope.

Tested in UNICODE.


#include <LoadLibrary.h>


CLoadLibrary lib( "Kernel32" );
if( lib.IsLoaded() )
	if( lib.GetProcAddress( "SomeFunction" ) )
		//	Do something with the library


Click to view the source code

See also RealGetDiskFreeSpace for an example