GetProcAddress() Sample Generates C2106 Using C++ |
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
Issue type :
Technology : kbVCsearch kbAudDeveloper kbvc150 kbvc100 kbVC151 kbVC152
|
Last Reviewed: May 9, 2001 © 2001 Microsoft Corporation. All rights reserved. Terms of Use. |