views:

46

answers:

2

I was writing a c++/cli wrapper for a native c++ application, and when I finished writing code, it builds so well.

The native c++ is built to a static library (.lib) file, and I referenced it in my c++/cli wrapper, then I wrote a c# console application to test the wrapper. However, the debugger can be launched.If I commented the lines which referened the code in the wrapper, it worked well.

So when the debugger can not be launched I found that there's an unhandled exception appeared in the output window of visual studio: unhanded exception occured in msvcp90d.dll, access violation error writing location: 0ff......

Can anyone list some common senarios could cause this issue? Very appreciated with any answer.

A: 

Why no one wants to have a look at this question? Please experts, lead me to the right direction, I am very much appreciated.

jinge
A: 

I would step back and comment out the C++ code in your static lib and simply return from it. And check if the integration works.

Can you check for C++ Code Generation options? Try changing to multi-threaded runtime libs.

HJ
Thanks for the answer, I just can not access the code in the static lib. I've already changed that to ""multi-threaded" runtime libs, it does not work.
jinge