> I'm writing a mixed-mode C++ DLL which is used by an old C++
> application that I don't have the source code to. I'm amazed by the
[quoted text clipped - 4 lines]
> the debugger (so I can step through my DLL when called), or get the
> line number an exception occurred on?
Well, if you can't run under the debugger can you put a DebugBreak() line at
some point when your DLL gets invoked and step through from there?
Still, I'm not sure I understand what crashes when. The crash occurs only
when you debug?
Did you
1) build the DLL with VS.Net?
2) specify the "legacy" executable in the "command"
edit box on the Debugging properties page
3) launch the executable by starting the debugger
Is that the sequence that crashes? Does it crash immediately?
Regards,
Will
Max Christian - 05 May 2004 10:39 GMT
> Well, if you can't run under the debugger can you put a DebugBreak() line at
> some point when your DLL gets invoked and step through from there?
Unfortunately that causes the C++ app to crash immediately, which
surprised me as it's obviously my code that's running when
DebugBreak() is called.
> Still, I'm not sure I understand what crashes when. The crash occurs only
> when you debug?
Yes, only when debugging. I do exactly the three things you've listed
below (using VS.NET 2003), I get a warning about no debug info in EXE,
I click OK to debug anyway, and then I get this msg box:
"The application failed to initalize properly (0xc0000142). Click on
OK to terminate the application."
As I say, the app works fine when not under the debugger.
M
> Did you
>
> 1) build the DLL with VS.Net?
> 2) specify the "legacy" executable in the "command"
> edit box on the Debugging properties page
> 3) launch the executable by starting the debugger
(Yes, I did all of those.)
Max Christian - 05 May 2004 10:56 GMT
> Did you
>
> 1) build the DLL with VS.Net?
> 2) specify the "legacy" executable in the "command"
> edit box on the Debugging properties page
> 3) launch the executable by starting the debugger
I've found an answer to this -- I changed the Debugger Type from Auto
to Managed Only in Configuration Properties|Debugging and now it
works. (It crashes as before under both the Mixed and Native Only
modes.)
I hope that's useful to a future googler...
M