#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;
}
当采用_tWinMain作为入口函数时,第三个参数类型应定义为LPTSTR,表示WCHAR *型
#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;
}

 当采用WinMain作为入口函数时,第三个参数类型应定义为LPSTR,表示CHAR *型

 

否则出现“WinMain无法重载函数”或_tWinMain无法重载函数“”

相关文章:

  • 2021-07-13
猜你喜欢
  • 2022-12-23
  • 2021-06-13
  • 2021-09-26
  • 2021-12-10
  • 2021-10-08
  • 2021-08-10
相关资源
相似解决方案