Skip to main content
GameDev.net gamedev.net
🔒 Locked

problem with callback

Started by Noodles Dec 31, 2001 at 10:52 AM 0 replies 500+ views
Original Post
Noodles
Noodles
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
null_pointer
null_pointer
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:

class myclass
{
public:
static bool CALLBACK function(/*parameters*/);
};
 
// note the absence of "static" here
bool CALLBACK myclass::function(/*parameters*/)
{
// ...
}

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.