的錯誤,我在Visual Studio 2015年創建了一個基本的Windows C++應用程序,我有幾個誤區:的Visual Studio 2015年WinAPI的上的MessageBox
#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"
不要通過圖像顯示錯誤或代碼(內嵌或外部鏈接)。始終將錯誤的完整文本顯示爲文本。 – crashmstr
如果您要搜索消息文本,則應該已經找到了解決方案。 – MSalters