此程序是《VC++深入详解》第六章的第一个实例。在Visual C++ 6.0 环境下运行无误。但是,本人应用Visual Studio 2010最新发布的正式版运行出现如下错误提示:1>c:\users\zhangxuefeng\documents\visual studio 2010\projects\menu\menu\mainfrm.cpp(433): error C2664: 'CWnd::MessageBoxW' : cannot convert parameter 1 from 'const char [3]' to 'LPCTSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
请教,这是什么原因,应该如何更改才能正确运行?望高手指点,谢谢!
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
请教,这是什么原因,应该如何更改才能正确运行?望高手指点,谢谢!
解决方案 »
- 创建的对话框工程,在app类里添加Run虚函数,不被调用
- 关于静态与动态调用的dll的问题
- 关于Windows Update Agent API, IUpdateSession::CreateUpdateInstaller始终不成功
- 初学ATL COM的问题
- 内存回收问题!!!
- 请问,如何用ZIP算法压缩(解压缩)一个字符串(应该是一段内存空间,不一定是字符类型的)?
- 在MFC單文檔程序中如何做出像VC++一樣的界面?
- 超简单问题!
- 面试时这种问题怎么回答呀?
- 急救:进制转换问题
- 想做一个俄罗斯方块,但却不响应WM_KEYDOWN事件...请问是怎么回事??
- 寻判断两个Rect区域是否有重合最简单方法
将字符串用_T("测试字符串");表示即可。
VC默认不是UNICODE。
VS2008以上默认是UNICODE。
1>c:\users\zhangxuefeng\documents\visual studio 2010\projects\menu\menu\mainfrm.cpp(433): error C2065: '_T' : undeclared identifier
1>c:\users\zhangxuefeng\documents\visual studio 2010\projects\menu\menu\mainfrm.cpp(433): error C2143: syntax error : missing ')' before 'string'
1>c:\users\zhangxuefeng\documents\visual studio 2010\projects\menu\menu\mainfrm.cpp(433): error C2059: syntax error : ')'请指点!