请问MessageBox在Wince下

blaze_cn 2006-06-23 01:12:05
void CMessageboxView::OnLButtonDown(UINT nFlags, CPoint point)
{
MessageBox("LBUTTONDOWN");
// TODO: Add your message handler code here and/or call default
CView::OnLButtonDown(nFlags, point);
}
这样一段代码,在vc++6.0中正常工作
在evc++4.0中编译错误
error C2664: 'MessageBoxW' : cannot convert parameter 1 from 'char [12]' to 'const unsigned short *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.
请问是为何
...全文
260 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
blaze_cn 2006-06-23
  • 打赏
  • 举报
回复
Wince只支持UNICODE,因此调用API时要使用宽字符串
明白了
blaze_cn 2006-06-23
  • 打赏
  • 举报
回复
谢谢
不过我碰到另一个问题
如果我用
MessageBox((LPCTSTR)"LBUTTONDOWN");
会出现一堆乱码,这是为什么呢?
无聊客 2006-06-23
  • 打赏
  • 举报
回复
MessageBox(_T("LBUTTONDOWN"));
blaze_cn 2006-06-23
  • 打赏
  • 举报
回复
自己搞定了
要进行显式的类型转换

7,655

社区成员

发帖
与我相关
我的任务
社区描述
Windows Phone是微软发布的一款手机操作系统,它将微软旗下的Xbox LIVE游戏、Zune音乐与独特的视频体验整合至手机中。
社区管理员
  • Windows客户端开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧