“APIENTRY _tWinMain” and “WINAPI WinMain” difference

后端 未结 3 974
北恋
北恋 2020-12-02 17:27

What are the difference from these 2 function?:

int APIENTRY _tWinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                            


        
3条回答
  •  [愿得一人]
    2020-12-02 18:28

    _tWinMain is just a #define shortcut in tchar.h to the appropriate version of WinMain.

    If _UNICODE is defined, then _tWinMain expands to wWinMain. Otherwise, _tWinMain is the same as WinMain.

    The relevant macro looks something like this (there's actually a lot of other code interspersed):

    #ifdef  _UNICODE
    #define _tWinMain  wWinMain
    #else
    #define _tWinMain  WinMain
    #endif
    

提交回复
热议问题