#include "windows.h" #include "tchar.h" int apientry _twinmain (hinstance hinstance,hinstance hprevinstance,lptstr Lpcmdline,int ncmdshow) {MessageBox (NULL, Text ("hello,world!"), text ("haha"), MB_OK); return 0;}
When using _tWinMain as the entry function, the third parameter type should be defined as LPTSTR, which represents the WCHAR * type
#include "windows.h" #include "tchar.h" int apientry WinMain (hinstance hinstance,hinstance hprevinstance,lpstr Lpcmdline,int ncmdshow) {MessageBox (NULL, Text ("hello,world!"), text ("haha"), MB_OK); return 0;}
When using WinMain as the entry function, the third parameter type should be defined as LPSTR, which represents the char * type
Otherwise "WinMain cannot overload function" or _tWinMain cannot overload function ""
Win32 API Programming: WinMain cannot overload functions or _tWinMain cannot be overloaded