首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

cannot convert parameter 一 from 'const char [12]' to 'LPCTSTR'

2012-09-01 
cannot convert parameter 1 from const char [12] to LPCTSTR第一个c++就遇到这个问题:cannot conver

cannot convert parameter 1 from 'const char [12]' to 'LPCTSTR'

第一个c++就遇到这个问题:

cannot convert parameter 1 from 'const char [12]' to 'LPCTSTR';


就是参数一的类型错误,本来应该用LPCWSTR,而传进去了一个字符数组。我用的是visual studio 2010.


解决方法是:

?

Change your project configuration to use multibyte strings. Press ALT+F7 to open the properties, and navigate to ? ? ? ? ?Configuration Properties > General. Switch Character Set to "Use Multi-Byte Character Set".


修改项目属性:

在?ALT+F7 然后?Configuration Properties > General 里面有个Character Set

我这里默认的是unicode 的 ,将其改为 ?"Use Multi-Byte Character Set"就可以了。

热点排行