Click here to Skip to main content
15,891,763 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
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 ?
Posted
Updated 8-Jan-13 1:28am
v3

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.
 
Share this answer
 
Comments
YDaoust 16-Jul-11 9:45am    
Thank you for the suggestions.

Statically linking to RTL is not possible for mixed-mode assemblies.

I will now throughly compare the options in the projects (most of the time I stick to the default ones).
YDaoust 16-Jul-11 14:59pm    
Then native project was compiled with /noclr while the wrapper was /clr. Setting both projects to /clr does the trick.

Thanks again for helping.
I also got same exception and got good answer here.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900