debug build crashes when calling managed code
- From: "Dave Calkins" <david.calkins@xxxxxxxxxxxxxxx>
- Date: Thu, 8 Mar 2007 17:40:42 -0500
We're using Visual Studio 2005 and have developed a native C++/MFC
application.
Our application makes use of a third party library which is written in
managed code. The provider exposes a native C++ interface to us which we
call.
When running our app in a release build it works fine. If we switch over to
a debug build, though, and try to run, our code crashes as soon as we call
into this third party library.
In the debugger, when we call one of their APIs (we're calling a method on a
class defined in their library), the app crashes and the call stack looks
like the below. The method we're calling takes a reference to an instance
of one of the classes defined by them. We construct an instance locally on
the stack and then call the method providing a reference to that instance.
msvcr80.dll!_crt_debugger_hook(int _Reserved=4802697) Line 65 C
msvcr80.dll!_invalid_parameter(const wchar_t * pszExpression=0x00000000,
const wchar_t * pszFunction=0x00000000, const wchar_t * pszFile=0x00000000,
unsigned int nLine=0, unsigned int pReserved=0) Line 86 + 0x7 bytes C++
msvcr80.dll!_invalid_parameter_noinfo() Line 99 + 0xc bytes C++
mscorwks.dll!_PreStubWorker@4() + 0xe7 bytes
05093eef()
mscorwks.dll!_PreStubWorker@4() + 0xe7 bytesOURAPP.exe!THIRDPARTYCLASS::THIRDPARTYMETHOD() Line 546 C++
Switching back to Release mode fixes it, however, we lose debugging
functionality. Tracing through code is unreliable and examining values is
problematic in a Release build.
Any ideas?
Thanks!
.
- Follow-Ups:
- RE: debug build crashes when calling managed code
- From: Charles Wang[MSFT]
- Re: debug build crashes when calling managed code
- From: David Lowndes
- RE: debug build crashes when calling managed code
- Prev by Date: Re: error LNK2019: unresolved external symbol
- Next by Date: Re: debug build crashes when calling managed code
- Previous by thread: MAX_PATH
- Next by thread: Re: debug build crashes when calling managed code
- Index(es):
Relevant Pages
|