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>calldll()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
CallDLL()
Call a function in a dynamic link library
------------------------------------------------------------------------------

Syntax
CallDLL( <cProc> [ , <xParam> ] , . . . )   -->   xResult

Arguments
<cProc> is a string specifying the function to be called, and
must have been returned by the GetProcAddress() function.

<xParam> is zero or more parameters, whose types must agree
with those specified when the GetProcAddress() function was
called.  (Numeric values are converted to integer/long
automatically.)

Returns
The return type is as specified originally when
GetProcAddress() was called.

Description
This function and the related functions LoadLibrary() and
GetProcAddress() can be used to access dynamic link libraries
(DLL's).

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
cRectangle = GetProcAddress( hLib, "rectangle",   ;    // get by name
                         "Pascal", "int",    ;    // Pascal, returns int
                         "int, int, int, int, int" )   // 5 int params
hDC = GetDC( hWnd )
CallDLL( cRectangle, hDC, 10, 10, 300, 300 )   // see also Rectangle()
ReleaseDC( hWnd, hDC )
FreeLibrary( hLib )


See Also: FreeLibrary() GetProcAddress() LoadLibrary()

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