Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.



This topic is 6064 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

Microsoft defines many of its own types such as INT instead of the default C/C++ int. This is mainly due to the fact that windows can span multiple architectures and can change in the future, as it did when windows moved from 16bit to 32bit, causing all c++ int to go from 16 to 32 bits. Thus if you use INT, the idea is you can just change the header defining INT and recompile your code for the new architecture with minimal changes. You can see that WINAPI is defined as __stdcall (for win32) or far pascal (win16) in windef.h depending on the target platform. This mainly has to do with the way arguments to the function are pushed on the stack (i.e. the backwards pascal order). CALLBACK is the same thing. LRESULT is just a LONG, or a long. You should just use the windows defined types wherever they are appropriate (like declaring WinMain) so that when and if the platform changes you do not have any problems recompiling code:


You could put

int __stdcall WinMain

but its less portable and considered bad style.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!