Microsoft Visual C++ Runtime Library_Debug Assertion Failed!
2015-04-21 22:07
1006 查看
开发环境:Visual Studio 2012
VTK版本:VTK-5.10.1
问题描述:按照VTK-5.10.1的例程vtkSDI进行实验的时候,运行时提示:
![](http://img.blog.csdn.net/20150421215534902)
点击“重试(R)”,提示:
![](http://img.blog.csdn.net/20150421220421621)
点击“中断(B)”,这时打开了afxwin1.inl文件,并且定位到了提示错误的行:
![](http://img.blog.csdn.net/20150421220558731)
由上图可见,出错的位置为函数:
函数分析:
根据参考资料[3]说明可知,AfxGetInstanceHandle()的功能是获取当前实例句柄。这里发生ASSERT()失败,表明当前afxCurrentInstanceHandle为NULL。
对于这个问题,网上流行很多种说法,其中参考资料[11]中有人提到“This can happen if you mix unicode/mbcs or debug/release build modes for DLL/application"。
根据上述提示,将项目的”字符集“设置为”未设置“,问题解决!
![](http://img.blog.csdn.net/20150421230204312)
参考资料
[1]microsoft visual c++ runtime library
[2]解决microsoft visual c++ runtime library办法
[3]AfxGetInstanceHandle
[4]_AFXWIN_INLINE 是什么意思
[5]HINSTANCE
[6]CALLBACK, WINAPI, AFXAPI和函数调用方式
[7]assert
[8]MFC Windows应用程序设计(第3版). 任哲 等编著. 清华大学出版社:14~15
[9]ASSERT(afxCurrentInstanceHandle!=NULL)
[10]调用HINSTANCE hInst = AfxGetInstanceHandle();程序在ASSERT(afxCurrentInstanceHandle != NULL);崩溃
[11]AfxGetInstanceHandle() triggers an assertion failure
VTK版本:VTK-5.10.1
问题描述:按照VTK-5.10.1的例程vtkSDI进行实验的时候,运行时提示:
点击“重试(R)”,提示:
点击“中断(B)”,这时打开了afxwin1.inl文件,并且定位到了提示错误的行:
由上图可见,出错的位置为函数:
_AFXWIN_INLINE HINSTANCE AFXAPI AfxGetInstanceHandle() { ASSERT(afxCurrentInstanceHandle != NULL); return afxCurrentInstanceHandle; }
函数分析:
_AFXWIN_INLINE——内联函数[4] HINSTANCE——实例句柄[5] AFXAPI——调用约定[6][8]
根据参考资料[3]说明可知,AfxGetInstanceHandle()的功能是获取当前实例句柄。这里发生ASSERT()失败,表明当前afxCurrentInstanceHandle为NULL。
对于这个问题,网上流行很多种说法,其中参考资料[11]中有人提到“This can happen if you mix unicode/mbcs or debug/release build modes for DLL/application"。
根据上述提示,将项目的”字符集“设置为”未设置“,问题解决!
参考资料
[1]microsoft visual c++ runtime library
[2]解决microsoft visual c++ runtime library办法
[3]AfxGetInstanceHandle
[4]_AFXWIN_INLINE 是什么意思
[5]HINSTANCE
[6]CALLBACK, WINAPI, AFXAPI和函数调用方式
[7]assert
[8]MFC Windows应用程序设计(第3版). 任哲 等编著. 清华大学出版社:14~15
[9]ASSERT(afxCurrentInstanceHandle!=NULL)
[10]调用HINSTANCE hInst = AfxGetInstanceHandle();程序在ASSERT(afxCurrentInstanceHandle != NULL);崩溃
[11]AfxGetInstanceHandle() triggers an assertion failure
相关文章推荐
- Qt生成并发布程序在别的机器上运行 发生Microsoft Visual C++ Runtime Library 错误
- Microsoft Visual C++ Runtime Library Runtime Error的解决的方法
- Microsoft Visual C++ Runtime library not enough space for thread data
- Microsoft Visual C++ Runtime Library Runtime Error的解决的方法
- 关于 microsoft visual c++ debug library
- Microsoft Visual C++ Runtime Library Runtime Error的解决的方法
- 请问如何解决Microsoft Visual C++ Runtime Library
- Microsoft Visual C++ Runtime Library Runtime Error解决的方式
- 打开word或者office程序报错:Microsoft Visual C++ Runtime Library. Runtime Error!
- microsoft visual c++ runtime library 的解决方法
- Microsoft Visual C++ Runtime Library Runtime Error的解决的方法
- Microsoft Visual C++ Runtime Library Runtime Error的解决办法
- [原创]解决Qt在windows发布时提示 Microsoft Visual C++ Runtime Library 错误解决办法
- “Microsoft Visual C++ Runtime Library”错误
- 查询Microsoft Visual C++ Debug Library窗体并自动点击忽略按钮的小工具代码
- Microsoft Visual C++ Runtime Library Runtime Error的解决的方法
- Microsoft Visual C++ Runtime Library Runtime Error的解决的方法
- “Microsoft Visual C++ Runtime Library”错误
- Microsoft Visual C++ Runtime Library Runtime Error解决的方式
- Microsoft Visual C++ Runtime Library Runtime Error的解决办法