我在 Visual Studio 2015 中创建了一个基本的 Windows C++ 应用程序,但出现了一些错误:
#include <windows.h>
#include <stdlib.h>
#include <string.h>
#include <tchar.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
MessageBox(NULL, "Test_text", "Message Test", MB_ICONINFORMATION | MB_OKCANCEL);
return 0;
}
错误:
'int MessageBoxW(HWND,LPCWSTR,LPCWSTR,UNIT)': cannot convert argument 2 from 'const char [10]' to 'LPCWSTR' argument of type "const char *" is incompatible with parameter of type "LPCWSTR" argument of type "const char *" is incompatible with parameter of type "LPCWSTR"