GetProcAddress() Sample Generates C2106 Using C++ID: Q117869
|
where lpfnTimerCount is defined as follows:(FARPROC) lpfnTimerCount = GetProcAddress(hinstToolHelp, "TimerCount");
The error can be eliminated by using a typecast on the right side of the equation instead of on the left side. The following code fragment demonstrates how to cast the function pointer defined in the sample code so that the sample code compiles without error:BOOL (FAR * lpfnTimerCount) (TIMERINFO FAR*);
lpfnTimerCount =
(BOOL (FAR *)(TIMERINFO FAR*))GetProcAddress(hinstToolHelp,
"TimerCount");
Additional query words: kbinf 1.00 1.50
Keywords : kb16bitonly
Version :
Platform :
Issue type :
Last Reviewed: July 27, 1999