i am writting a program using Native C++ as dll , C++ CLI as a wrapper and C# for the UI. When I build it in Debug mode, it works fine , but in Release mode it throws an Access Exception. what's worse , when i debug it from C# code，i could not debug into the CLI code，much less the Native C++ DLL Code. But the exception throwed by the program showed that the error exists in the dll, i could not debug into it . Any help?
The exception may be produced like this:
In C# , i press button A, and then in Native C++ DLL , there is a class A uses malloc to allocate the memory and class B has an array of 256 chars and Class A will dynamic allocate the memory for creating a dynamic link list. The first time always works fine，after press button B，class A and Class B is deleted with out any problem. when i press Button A again.,The class A and Class B is created using new operator with out any problem, But when i access the char array in Class B, the program throws out the exception. If i commented dynamic link list code in class A , the exception gone. so i think the problem comes from the memory allocated . but , i could not debug into it.