problem with callback
hi,
i have a class which does all my graphics in the app im developing.
in its init function the following code poses problems when i try to enumerate directdraw devices:
//...
DirectDrawEnumerateEx(EnumDirectDrawCallback, NULL, DENUM_ATTACHEDSECONDARYDEVICES | DDENUM_DETACHEDSECONDARYDEVICES |DDENUM_NONDISPLAYDEVICES );
//...
EnumDirectDrawCallback is a static member function of the graphics class declared as follows:
static BOOL CALLBACK EnumDirectDrawCallback(GUID*, char*, void*, HMONITOR);
whether I put WINAPI, PASCAL or even __stdcall, the compiler still thinks this function is of type __cdecl?
can anibody tell me what the heck is going on?
thanks
I am not sure what is causing the error. Make sure that when you declare a static member function, you only use the "static" keyword when declaring it.
Example:
Example:
class myclass{public: static bool CALLBACK function(/*parameters*/);}; // note the absence of "static" herebool CALLBACK myclass::function(/*parameters*/){ // ...}
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement