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>_ndll</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
_NDLL
Create a function to call a DLL
------------------------------------------------------------------------------

Syntax
#include "dll.ch"
_NDLL [ STATIC ] FUNCTION <name> ( [ <p1> AS | REF <type1>, ] ... )
     AS <returnType>
     [ PASCAL | C]
     : [ <lib> ] . <entryNum>

Arguments
Same as _DLL, except that <entryNum> is a number identifying
the function in the DLL by ordinal.  You need to leave a space
before the number to keep the Clipper pre-processor happy.

Description
This command is the same as _DLL, but specifies the entry
point by "ordinal" (its position number).  It is a little bit
faster than using _DLL, but is usually only used if the DLL
function is not exported by name.

Example
Here are some C function prototypes and their equivalents:

//BOOL WINAPI VBXInit(HINSTANCE instance, LPCSTR classPrefix);
_NDLL function VBXInit(hInst AS HINSTANCE, cClass AS LPCSTR) ;
          AS BOOL Pascal:BIVBX102. 14

//void WINAPI VBXTerm(void);
_NDLL function VBXTerm() ;
          AS VOID Pascal:BIVBX102. 15

//HCTL WINAPI VBXGetHctl(HWND window);
_NDLL function VBXGetHCtl(hWnd AS HWND) ;
     AS DWORD Pascal:BIVBX102. 13

//HWND WINAPI VBXGetHwnd(HCTL control);
_NDLL function VBXGetHWnd(hCtl AS DWORD)     ;
     AS HWND Pascal:BIVBX102. 12

/*HCTL WINAPI VBXCreate(HWND windowParent, UINT id,
                        LPCSTR library, LPCSTR cls,
                        LPCSTR title, DWORD style,
                        int x, int y, int w, int h,
                        HFORMFILE file);
*/
_NDLL FUNC VBXCreate(windowParent AS HWND, id AS UINT,       ;
                     library AS LPCSTR, cls AS LPCSTR,       ;
                     title AS LPCSTR, style AS DWORD,        ;
                     x AS int, y AS int, w AS int, h AS int, ;
                     file AS HANDLE)                         ;
     AS DWORD Pascal:BIVBX102. 71


See Also: _DLL GetProcAddress()

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