views:

33

answers:

1

I'm writing an addin DLL in C# for a host application written in C++ (I do not have source for the host app). When I run the host application, it loads my DLL for use during that session. Recently, I've been seeing the following error upon exit of the host application:

Microsoft Visual C++ Runtime Library
Runtime Error!
Program: MyHostApp.exe

This application has requested the Runtime to terminate it in an unusual way...

This dialog only contains an "OK" button (no debug button). After pressing OK, the host app exits without giving any indication of what might have caused the error.

I found this stackoverflow thread with a similar problem...

http://stackoverflow.com/questions/440355/how-to-debug-a-visual-c-runtime-error

But, whenever I try to attach VS2008 to the crashed application, and then do a "break all" as instructed, I only get the following message from VS:

"Unable to break execution. This process is not currently executing the type of code that you selected to debug."

How should I approach debugging this?

A: 

Did you trying setting the "Native Code" option when starting the debugger?

Jay
If you mean "Tools | Options | Debugging | Just-In-Time | Native", yes, it's checked.
Jeff Godfrey
Ah, I think I see what you mean... In the "Attach to Process" dialog, I can select "Native code". Doing that gets me past the initial message mentioned in the OP. However, now when I do a "break all", I get a "No symbols are loaded for any call stack frame. The source code cannot be displayed."I guess that makes sense as I don't have source or symbols for the crashing host app. I'm certain that something in my DLL is causing the host to crash, I just don't know how to find it...
Jeff Godfrey