문제

In trying to get a grasp on creating windows (in Windows OS), I encountered this function definition

LRESULT CALLBACK Window::MsgRouter(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)

(taken from here)

Me being only a beginner in C++ I interpreted that to mean that it's return type was both LRESULT and CALLBACK

Is CALLBACK some special type? My other question is, what is a WPARAM and an LPARAM?

Thanks in advance, ell.

도움이 되었습니까?

해결책

No, it's not a type, it's a modifier. Both CALLBACK and WINAPI resolve to __stdcall, which is standard calling convention for WinAPI functions.

WPARAM and LPARAM are message parameters' types, all types used in the API are documented on MSDN.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top