Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


problem with callback

This topic is 6047 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post

Link to post
Share on other sites
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.


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

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!