pciGrabber-4x4
86
PHYTEC Messtechnik GmbH 2008 L-720e_0
6.2.5
Application of the Windows XP/VISTA
TM
Windows
NT4.0
TM
/ Windows 2000
TM
DLLs
In order to use the DLL
Gr4CDLL.DLL
, the software developer must
define a function pointer for each function that will be used in the
application.
Example:
•
Function to be used:
WORD Get_Error(void)
•
Definition of the function pointer:
WORD (PASCAL * lpfn_GetError)(void);
Use
GetProcAddress(…)
to obtain the relationship between the
function pointer and the DLL.
Example:
lpfn_GetError = (WORD(PASCAL *)(void))
GetProcAddress(handle, „Get_Error“);
The function can now be called with:
WORD Errorstatus;
...
Errorstatus = lpfn_GetError();
Caution:
Check the value of the function pointer (return value from
GetProcAddress) to be sure that it = 0. A value of 0 ensures that the
driver version installed on the user’s computer supports the functions
and will return a valid handle.