argument of type const char* is incompatible with parameter of type “LPCWSTR”

前端 未结 3 1986
时光取名叫无心
时光取名叫无心 2020-12-05 23:54

I am trying to make a simple Message Box in C in Visual Studio 2012, but I am getting the following error messages

argument of type const char* is incompat         


        
3条回答
  •  悲哀的现实
    2020-12-06 00:12

    To make your code compile in both modes, enclose the strings in _T() and use the TCHAR equivalents

    #include 
    #include 
    
    int WINAPI _tWinMain(HINSTANCE hinstance, HINSTANCE hPrevinstance, LPTSTR lpszCmdLine, int nCmdShow)
    {
        MessageBox(0,_T("Hello"),_T("Title"),0);
        return 0;
    }
    

提交回复
热议问题