Jump to content
  • Advertisement

Archived

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

n0ob

typedef function pointer to window callback.. help

This topic is 5396 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

I''m trying to make a typedef to a function pointer to a window callback function: typedef LRESULT CALLBACK(*JWFP)(HWND, UINT, WPARAM, LPARAM); But I get errors when trying to incorporate the __stdcall / CALLBACK into it. Anyone know what the correct syntax is? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Hi no0b

windows.h already provides the exact typedef you are trying to create, its called WNDPROC. Its defined as


typedef LRESULT (CALLBACK* WNDPROC)(HWND, UINT, WPARAM, LPARAM);


Hope that helps

Share this post


Link to post
Share on other sites
When typedeffing a function pointer, the calling convention should be placed inside the parens:

typedef LRESULT (CALLBACK *JWFP)(HWND, UINT, WPARAM, LPARAM);


Share this post


Link to post
Share on other sites
quote:
Original post by LessBread
When typedeffing a function pointer, the calling convention should be placed inside the parens:

typedef LRESULT (CALLBACK *JWFP)(HWND, UINT, WPARAM, LPARAM);





Hasnt that already been shown ?

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!