Reputation: 31
does anybody know if is possible to add __stdcall (CALLBACK) in function parameter like this?:
void Function(LRESULT CALLBACK (*f)(HWND, UINT, WPARAM, LPARAM));
It gives me following error:
a calling convention may not be followed by a nested declarator
Any solutions?
Thx in advance <3
Upvotes: 0
Views: 182
Reputation: 38890
Usually it is seen in the manual, for example CallWindowProcW function
the lpPrevWndFunc parameter has the data type
WNDPROC
. TheWNDPROC
type is declared as follows:
LRESULT (CALLBACK* WNDPROC) (HWND, UINT, WPARAM, LPARAM);
Thus, the correct syntax is (WNDPROC
-> f
)
void Function(LRESULT (CALLBACK* f)(HWND, UINT, WPARAM, LPARAM));
Upvotes: 1
Reputation: 15172
Put the calling convention inside the parenthesis.
void Function(LRESULT (CALLBACK *f)(HWND, UINT, WPARAM, LPARAM));
Upvotes: 1