无法从'为const char [14]'到'LPCWSTR'转换参数2 [英] Cannot convert parameter 2 from 'const char [14]' to 'LPCWSTR'
本文介绍了无法从'为const char [14]'到'LPCWSTR'转换参数2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我得到这个错误:
cannot convert parameter 2 from 'const char [14]' to 'LPCWSTR'
通过下面的code。它应该是C,但在最好的Visual Studio 2012提供了一个空的C ++项目:
With the code below. It is supposed to be C but at best visual studio 2012 offers an empty c++ project:
#include "windows.h"
int WINAPI WinMain (HINSTANCE hinst, HINSTANCE hprevinst, LPSTR cmdline, int showcmd)
{
MessageBox(NULL, "Merhaba Dunya", "Merhaba", MB_OK);
return 0;
}
什么是不正确的?
What is incorrect?
推荐答案
看来你的当前设置设置,以便WinAPI的函数期望宽字符串:
It seems your current settings are set up so that WinAPI functions expect wide strings:
MessageBox(NULL, L"Merhaba Dunya", L"Merhaba", MB_OK);
这篇关于无法从'为const char [14]'到'LPCWSTR'转换参数2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文