AfxMessageBox 在vs 2008中的问题
2010-06-11 11:43
190 查看
这是第一篇文章,记下我做的又一件愚蠢事:
懒人一头,所以在家没有学习的习惯,偶尔心血来潮在家装个VS2008搞点小程序玩。
装了半天,搞定后就急不可待地用个小程序测试下,生成个对话框,点OK用AfxMessageBox跳出来个提示,以此来证明环境是否有正常。
使用AfxMessageBox("hahahaha");居然生成有错误,
改为AfxMessageBox(L"hahahaha");就OK了,究其原因应该是“字符集”的问题,改“使用 Unicode 字符集”为 “使用多字节字符集”
使用AfxMessageBox("hahahaha");就正常了。
说下做的乌龙事:一看用个AfxMessageBox("hahahaha");就编译不通过,有错误,想都没有想,更没有去网上查下原因。就把问题归结到VS2008身上,是不是安装的有问题,然后一气之下就把它卸载了,然后又安装……搞了近一个上午。
ps:
Points to a CString
object or null-terminated string containing the message to be displayed in the message box.
nType
The style of the message box. Apply any of the message-box styles
to the box.
nIDHelp
The Help context ID for the message; 0 indicates the application's default Help context will be used.
in the message box and uses nIDHelp
to describe a Help context. The Help context is used to jump to an
associated Help topic when the user presses the Help key (typically F1).
懒人一头,所以在家没有学习的习惯,偶尔心血来潮在家装个VS2008搞点小程序玩。
装了半天,搞定后就急不可待地用个小程序测试下,生成个对话框,点OK用AfxMessageBox跳出来个提示,以此来证明环境是否有正常。
使用AfxMessageBox("hahahaha");居然生成有错误,
改为AfxMessageBox(L"hahahaha");就OK了,究其原因应该是“字符集”的问题,改“使用 Unicode 字符集”为 “使用多字节字符集”
使用AfxMessageBox("hahahaha");就正常了。
说下做的乌龙事:一看用个AfxMessageBox("hahahaha");就编译不通过,有错误,想都没有想,更没有去网上查下原因。就把问题归结到VS2008身上,是不是安装的有问题,然后一气之下就把它卸载了,然后又安装……搞了近一个上午。
ps:
int AfxMessageBox( LPCTSTR lpszText, UINT nType = MB_OK, UINT nIDHelp = 0 );
Parameters
lpszTextPoints to a CString
object or null-terminated string containing the message to be displayed in the message box.
nType
The style of the message box. Apply any of the message-box styles
to the box.
nIDHelp
The Help context ID for the message; 0 indicates the application's default Help context will be used.
Remarks
The first form of this overloaded function displays a text string pointed to by lpszTextin the message box and uses nIDHelp
to describe a Help context. The Help context is used to jump to an
associated Help topic when the user presses the Help key (typically F1).
Example
// A simple message box, with only the OK button. AfxMessageBox("Simple message box."); // A message box that uses a string from a string table // with yes and no buttons and the stop icon. // NOTE: nStringID is an integer that contains a valid id of // a string in the current resource. AfxMessageBox(nStringID, MB_YESNO|MB_ICONSTOP);
相关文章推荐
- 关于vs 2008字符集问题
- VS 2008和.NET 3.5 Beta2常见问题的解决方案
- Profile 在 VS 2008 下之怪异问题求指点
- vs 2008 asp设计视图不能用的问题解决(肯定可行!这个问题搞的我好晕!)
- VS 2008 SP1及其问题
- VS 2008/2010无法清理解决方案和项目问题的解决
- 解决:安装 vs 2008 sp1 提示变成英文问题
- VS 2008 beta2英文版的SvcUtil问题
- vs 2008链接到TFS 2010 出现问题
- vs 2008 过期问题
- VS 2008与老版本插件的兼容性问题导致Crash
- 使用vs 2008创建项目,没出现解决方案的问题
- vs 2008 过期问题
- VS 2008 SP1及其问题
- VS 2008的问题
- 问大家一个简单的vs 2008调试的问题?
- VS 2005/2008生成程序的自动版本号问题
- 解决:VS 2005/2008 中 fstream 不能处理带有中文路径的问题
- 解决 VS 2008 不能创建新项目,“The tools version “3.5″ is unrecognized ” 问题
- sql 2008 和 vs 2010 连数据库问题