如题
比如我现在
int error=GetLastError();得到的error=10093
我怎么查看10093是什么错?在哪找?还有一个问题是
try{} catch(){}
在catch里怎么把出错的信息打印出来?
比如我现在
int error=GetLastError();得到的error=10093
我怎么查看10093是什么错?在哪找?还有一个问题是
try{} catch(){}
在catch里怎么把出错的信息打印出来?
解决方案 »
- MFC,如何把控件设置为顶层,不管是否被激活
- [急切求助]WebBrowse校内网写日志,提交时提示是否离开页面。。。
- 求助啊!!!对话框能不能添加一个像CListBox一样的智能滚动条。
- 文件输出
- 给点建议!
- 一MM相求,特来告急:求一个VC写的时间控件!
- 我想在網上買<深入淺出MFC>
- 怎么样知道在网络中的终端的IP地址??
- 我该怎么办::CHtmlView的程序,打开一个网页后,再点击网上的链接,会弹出另一个IE窗口,如何才能避免,只在我的程序中浏览网页。。。
- 求放大缩小一幅位图的代码
- [急]为什么我做的控件在网页中使用鼠标事件没响应?
- A duplllicate insert block exists for class "CEditDlg" in the source files.....
用FormatMessage可以直接在程序中转换为显示中文的错误
也可以用vs中的error lookup
吗,不要抄袭,没道德
The FormatMessage function can be used to obtain error message strings for the system error codes returned by GetLastError, as shown in the following sample code.LPVOID lpMsgBuf;
if (!FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
(LPTSTR) &lpMsgBuf,
0,
NULL ))
{
// Handle the error.
return;
}// Process any inserts in lpMsgBuf.
// ...// Display the string.
MessageBox( NULL, (LPCTSTR)lpMsgBuf, "Error", MB_OK | MB_ICONINFORMATION );// Free the buffer.
LocalFree( lpMsgBuf );
For an additional example, see Looking Up Text for Error Code Numbers.
Tools->error lookup