all groups > visual studio .net debugging > march 2007 >
You're in the

visual studio .net debugging

group:

Debugging thru AxHost


Re: Debugging thru AxHost Oleg Starodumov
3/5/2007 12:00:00 AM
visual studio .net debugging:

[quoted text, click to view]

Try the approach described here:
http://groups.google.com/group/microsoft.public.vsnet.debugging/browse_thread/thread/c44d7968853b88e1

--
Oleg
[VC++ MVP http://www.debuginfo.com/]




Debugging thru AxHost Manoharan
3/5/2007 12:28:19 AM
Hi,

How to debug VB6 Activex Usercontrol (ocx) hosted in VB.Net container.

Advanced thanks for your help

Manoharan
---
Re: Debugging thru AxHost mano
3/6/2007 4:06:37 AM
On Mar 5, 1:58 pm, "Oleg Starodumov" <com-dot-debuginfo-at-oleg>
[quoted text, click to view]

1. I created a test VB6 Ocx control with create symbolic debug info
and disabled optimizations.
2. Register the control using regsvr32
3. created a test VB.net application & hosted the registerd control in
the form enabled the Unmanaged code debug.
4. Ran the VB6 ocx application
5. Then ran the VB.Net application

It hangs it won't go the break point i have set in the VB6 ocx
control.

Is anything I am missing.


Please help me to debug the VB6 ocx control from VB.Net (thru interop)

regards

Manoharan
Re: Debugging thru AxHost Oleg Starodumov
3/6/2007 4:31:55 PM
[quoted text, click to view]

If it really hangs, break into debugger and check what it is doing.
If it works but does not hit breakpoints in VB6 code, open Modules window
and check if the ocx is loaded, and if its symbols have been loaded.

Oleg



Re: Debugging thru AxHost mano
3/6/2007 10:15:33 PM
On Mar 6, 7:31 pm, "Oleg Starodumov" <com-dot-debuginfo-at-oleg>
[quoted text, click to view]

1. How to open or enable Modules window in VS 2005.
2. when I am attaching the ocx provess to VS 2005, it hangs when I
break the control goes to VB6 ocx application but it is not hiting the
Break Point.

Please help to resolve/debug this.

regards

Mano


Re: Debugging thru AxHost mano
3/6/2007 11:29:11 PM
On Mar 6, 7:31 pm, "Oleg Starodumov" <com-dot-debuginfo-at-oleg>
[quoted text, click to view]

I found the way to opne the Modules window.

1. I ran the VB6 ocx control
2. attach the process to VS2005 debugger
3. I have opened the modules window bu the ocx & its symbol file is
not loaded.

Please help to resolve/debug this.

Regards

Manoharan





regards
Mano

Re: Debugging thru AxHost Oleg Starodumov
3/7/2007 12:00:00 AM
[quoted text, click to view]

In VB.NET application, set breakpoint at some place where you absolutely
sure that the ocx will be loaded. After that breakpoint is hit, check the presence
of the ocx and its symbols in Modules window.

[quoted text, click to view]

I am not sure that I understand why step 4 is needed. What kind of application
did you run in step 4? Usually you need only VB.NET application, which loads
the ocx, and do not need to run other applications.

Oleg



Re: Debugging thru AxHost Oleg Starodumov
3/7/2007 12:00:00 AM

[quoted text, click to view]

Try to show a message box from the ocx (when it is called by the client app).
While this message box is shown, break into debugger, check the call stack
and switch to a stack frame that belongs to the ocx. Will the debugger be able
to show you the ocx' sources in this case?

Oleg



Re: Debugging thru AxHost Oleg Starodumov
3/7/2007 12:00:00 AM
[quoted text, click to view]

I am not sure it's possible to step between VB.NET and VB6 code in this case,
AFAIR breakpoints always had to be used as a workaround.
Btw, do breakpoints work now? (e.g. if you set breakpoint in the source that has been
shown by the debugger, e.g. in a place that will be executed after you dismiss
the message box)

Oleg



Re: Debugging thru AxHost mano
3/7/2007 1:38:37 AM

[quoted text, click to view]

I did the above step & the ocx control is loaded and its symbol is al
lodaded.

This is the line I copied from the modules window.

"DebTest.ocx D:\debug test\DebTest.ocx N/A N/A Symbols loaded. D:
\debug test\DebTest.pdb 33 1.00.0.0 3/6/2007 5:28 PM 11000000-11006000
[3172] W.exe: Native "


I have set break point in the ocx also but it is not hiting the break
points of the ocx control.

I need to step into the OCX control.

regards

Mano

Re: Debugging thru AxHost mano
3/7/2007 3:18:38 AM
On Mar 7, 3:27 pm, "Oleg Starodumov" <com-dot-debuginfo-at-oleg>
[quoted text, click to view]

Yes in this case the Debugger shows the VB6 ocx source in VB.Net. But
I want step into VB6 Ocx control.

How I have to step into VB6 ocx.

Mano


Re: Debugging thru AxHost mano
3/8/2007 4:19:04 AM
On Mar 7, 4:44 pm, "Oleg Starodumov" <com-dot-debuginfo-at-oleg>
[quoted text, click to view]

Thanks for your responses and valuable guidence. This is helping me to
debug the ocx control to some extend using the .Net IDE.

Thanks & Regards

Manoharan
AddThis Social Bookmark Button