all groups > visual studio .net debugging > november 2004 >
You're in the

visual studio .net debugging

group:

Debugging Managed vs Unmanaged code, please help!!!


Debugging Managed vs Unmanaged code, please help!!! alex NO[at]SPAM meidan.co.il
11/25/2004 1:34:51 PM
visual studio .net debugging: Here is the situation:
I'm trying to debug an AutoCAD ObjectARX application written in C++
with VS.NET 2002
Everything worked fine untill i have used an embedded WebBrowser
control in one of my dialogs (Actually the control is contained in
another ActiveX control, so i can call "setExternal" on the
WebBrowser)

The thing is that now when i debug the debugger loads symbols for my
application files (which are C++ unmanaged DLLs), and ALSO it loads
symbols for msvcr71.dll which is a part of the .NET framework.

Now what happens is that when the appliction reaches the point where i
have set a break point and it should break into debugger both the
application (AutoCAD) and the .NET IDE freezes. My guess is that the
reason is that managed and native debugging have mixed somehow,
although the debug mode is set to "Native only". Now the most
interesting part is that if at this freezing point i kill the AutoCAD
process via task manager the App breaks into the debugger! I'm even
able to walk the call stack, view variable values etc, but this doesnt
help much since when i step into the next statement the app closes
(well i killed it's process, din't i) , so i'm unable to step through
the code...


Does anyone have any ideas how to prevent this behaviour ???
RE: Debugging Managed vs Unmanaged code, please help!!! v-garych NO[at]SPAM online.microsoft.com
11/26/2004 6:50:44 AM
Hi Alex,

[quoted text, click to view]

You mentioned the "managed and native debugging have mixed somehow" here,
why do you think it may be the reason?
Do you have any managed code in the program, or the program is a Managed
C++ one?

And you also point out the problem only occurs after you add an embedded
web-browser control to your program, how is this control, is it anything
particular?

By the way, do you have tried any other debug mode to debug the program?


Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
Re: Debugging Managed vs Unmanaged code, please help!!! alex NO[at]SPAM meidan.co.il
11/26/2004 8:14:11 AM
Thank you very much for quick reply.

I'm not sure that the reason to such strange behaviour is that managed
and unmaged code are mixed, although it crossed my mind.
The application i'm developing is native c++ only , no managed code
there.
The WebBrowser control i'm reffering to is a standard WebBrowser
control from Microsoft, available in shdocvw.dll.

The reason that i think it's some how responsable for the behaviour of
freezing both the VS.NET IDE and the debugged application is that ,
this behaviour only happens when i activate that dialog (there is
nothing else in the dialog but the WebBrowser control).
I also noticed that then only time that the msvcr71.dll is loaded , is
when i open that dialog.
Also it's strange to me that no symbols are loaded for any of the DLLs
(except my own) but for msvcr71.dll the debugger is loading symbols...
why?

And thanks again for your help...

[quoted text, click to view]
Re: Debugging Managed vs Unmanaged code, please help!!! alex NO[at]SPAM meidan.co.il
11/26/2004 8:19:04 AM
Please see my followup to Oleg , but I forgot to mention that I did
try ALL of other debug modes.
(Auto, mixed, etc...)


[quoted text, click to view]
Re: Debugging Managed vs Unmanaged code, please help!!! Oleg Starodumov
11/26/2004 10:03:42 AM

In addition to Gary's reply:

[quoted text, click to view]

msvcr71.dll is the DLL version of C runtime library (unmanaged).

[quoted text, click to view]

If you have two machines, try to debug remotely.

http://msdn.microsoft.com/library/en-us/vsdebug/html/vxoriRemoteDebuggingSetup.asp

Regards,
Oleg





Re: Debugging Managed vs Unmanaged code, please help!!! Oleg Starodumov
11/29/2004 11:24:51 AM

[quoted text, click to view]

It means that the application itself does not use msvcr71.dll,
but it is used by one of the DLLs which are loaded by the WebBrowser control.
While loading the control, take a look at Debug Output window
and you will see a couple of messages about loading DLLs.
One of them is linked to msvcr71.dll (you can check it with Depends tool)

[quoted text, click to view]

Because they are supplied with VS.NET and therefore are present
on your system.

Btw, have you tried remote debugging?

Regards,
Oleg


Re: Debugging Managed vs Unmanaged code, please help!!! v-garych NO[at]SPAM online.microsoft.com
12/1/2004 9:08:08 AM
Hi Alex,

Does this problem occur in some other machines,do you have tried Oleg's
suggestion?


Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
AddThis Social Bookmark Button