_CrtIsValidHeapPointer断言引发 [英] _CrtIsValidHeapPointer assertion raised

查看:77
本文介绍了_CrtIsValidHeapPointer断言引发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个包装现有非托管类库的类库。所有这些都是在Visual C ++ 2005下完成的(在认识到在VC 2003下几乎不可能)之后。



我试图在一个简单的表单中使用包装类应用。在调试模式下,我在调用任何代码之前得到_CrtIsValidHeapPointer断言。为了简化故障排除,调试器不会断点,也不提供任何调用堆栈信息。



我已确保运行时库选项在所有项目之间兼容(多线程调试DLL) )。



有什么建议吗?

解决方案

你试试静态链接的运行时而不是动态。你必须检查一些其他选项,如指针对齐等。某些选项可能在.NET选项和C ++运行时之间根本不兼容...



比较每种类型的新项目的默认选项(这是一个选项) .NET应用程序(或库)的非托管库和选项。



发布版本是否有效。



您也可以考虑在任一项目中发布已修改的选项列表,以及非托管类库和托管类库之间不同的选项列表。


我也有同样的例外并得到了很好的答案这里

I have developed a class library that wraps an existing unmanaged class library. All of this is done under Visual C++ 2005 (after realizing that it is virtually impossible under VC 2003).

I am trying to use the wrapper classes in a simple Forms application. In the debug mode, I am getting a _CrtIsValidHeapPointer assertion before any of my code is invoked. To ease troubleshooting, the debugger does not breakpoint nor provide any Call Stack information.

I have made sure that the Runtime Libraries options are compatible between all projects (Multithreaded Debug DLL).

Any suggestion ?

解决方案

You migth try statically linked run-time instead of dynamic. You have to check some other options like pointer alignment and such. Some options might be fundamentally incompatible between .NET options and C++ run-time...

Compare default options of a new projects of each types (that is options for an unmanaged libraries and options for a .NET application (or library).

Does the release version seems to works.

You might also consider to post the list of options you have modified in either project and the list of options that are different between an unmanaged class library and and a managed one.


I also got same exception and got good answer here.


这篇关于_CrtIsValidHeapPointer断言引发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆