Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide to Clip-4-Win version 3.0 - <b>freelibrary()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
FreeLibrary()
Free a library (DLL)
------------------------------------------------------------------------------

Syntax
FreeLibrary( <hLibrary> )   -->   nil

Arguments
<hLibrary> is a handle to the library to be freed.

Returns
NIL.

Description
This function is used to indicate the application has stopped
using the specified library.  The related functions
GetProcAddress() and CallDLL() must not be used by an
application after it has freed a dynamic link library (DLL).

If successful, this function decreases the DLL's reference
count by one.  The related function LoadLibrary() increases
the count.  (The count determines when Windows must load a
library, and when it can be unloaded.)

Example
hLib = LoadLibrary( "KERNEL.EXE" )      // part of Windows
// This one returns a long (32-bit number), and has no params:
cGetWinFlags = GetProcAddress( hLib, 132, "Pascal", "Long")
? CallDLL( cGetWinFlags )               // see also GetWinFlags()
FreeLibrary( hLib )

hLib = LoadLibrary( "GDI.EXE" )               // part of Windows
cRectangl2 = GetProcAddress( hLib, 27,   ;    // ordinal number
                         "Pascal", "Int",  ;  // Pascal, returns int
                         "int, int, int, int, int" )   // 5 int params
hDC = GetDC( hWnd )
CallDLL( cRectangl2, hDC, 10, 10, 300, 300 )  // and see Rectangle()
ReleaseDC( hWnd, hDC )
FreeLibrary( hLib )


See Also: CallDLL() GetProcAddress() LoadLibrary()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson