Skip to main content
gamedev.net
🔒 Locked

Basic question about functions in Windows programmigng.

Started by digitalfreak May 21, 2003 at 8:42 AM 0 replies 300+ views
Original Post
digitalfreak
digitalfreak
I just started learning Windows programming,before I''ve only programmed in pure c/c++,java.In those languages,a function always takes the form of: return_type function_name(args...){body...}; but now in Windows programming,I frequently see functions like: int WINAPI MessageBox (HWND, LPCSTR, LPCSTR, UINT); or even more confusing: WINUSERAPI int WINAPI MessageBoxA (HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType); What''re the WINUSERAPI and WINAPI?Doesn''t these violate the function definition(declaration) rules?
Glyph
Glyph
Typically you won''t need to concern yourself with those... they are calling convention indicators. What they do is specify how parameters are passed to a callee function and how a return value is passed back to the caller. If you''ve got browse information turned on, you can right-click on WINAPI and see that it is just a #define for __stdcall or __cdecl or something like that. AFAIK, they aren''t Win32 specific, but I could be making that up Hope this helps.

-Glyph

Topic Locked

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

Sign in to reply to this topic.