Skip to main content
gamedev.net
🔒 Locked

typedef function pointer to window callback.. help

Started by n0ob 3 replies 450+ views
Original Post
n0ob
n0ob
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!
Jingo
Jingo
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
LessBread
LessBread
When typedeffing a function pointer, the calling convention should be placed inside the parens:

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


"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
quant
quant
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 ?

-keyboard

Topic Locked

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

Sign in to reply to this topic.