Jump to content
  • Advertisement
Sign in to follow this  
Uphoreum

Win32 Return Types

This topic is 4219 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've noticed that some Win32 functions seem to have two return types, like: int WINAPI WinMain... and LRESULT CALLBACK WinProc... I'm pretty sure that the second "return types" aren't really return types, but if they're not, what are they? I've never seen two words preceding a function name outside of Win32.

Share this post


Link to post
Share on other sites
Advertisement
The return types of those functions are int and LRESULT, respectively.
The 'keywords' WINAPI and CALLBACK indicate the calling convention used. The calling conventions describes how arguments are placed on the stack, and which registers of the CPU must be preserved.(More info: Wikipedia: x86 calling conventions). Note that WINAPI and CALLBACK actually are #defines for (OTOH) __stdcall and __cdecl.

Share this post


Link to post
Share on other sites
CALLBACK, WINAPI, PASCAL, and probably a few more that I cant remember right now are all #defined as __stdcall. None of them are #defined as __cdecl.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!