Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Debugging / March 2007

Tip: Looking for answers? Try searching our database.

Debugging thru AxHost

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Manoharan - 05 Mar 2007 08:28 GMT
Hi,

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

Advanced thanks for your help

Manoharan
Oleg Starodumov - 05 Mar 2007 08:58 GMT
> How to debug VB6 Activex Usercontrol (ocx) hosted in VB.Net container.

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


--
Oleg
[VC++ MVP http://www.debuginfo.com/]
mano - 06 Mar 2007 12:06 GMT
On Mar 5, 1:58 pm, "Oleg Starodumov" <com-dot-debuginfo-at-oleg>
wrote:
> > How todebugVB6Activex Usercontrol (ocx) hosted inVB.Netcontainer.
>
[quoted text clipped - 3 lines]
> Oleg
> [VC++ MVPhttp://www.debuginfo.com/]

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
Oleg Starodumov - 06 Mar 2007 14:31 GMT
> 1. I created a test VB6 Ocx control with create symbolic debug info
> and disabled optimizations.
[quoted text clipped - 6 lines]
> It hangs it won't go the break point i have set in the VB6 ocx
> control.

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
mano - 07 Mar 2007 06:15 GMT
On Mar 6, 7:31 pm, "Oleg Starodumov" <com-dot-debuginfo-at-oleg>
wrote:
> > 1. I created a test VB6 Ocx control with create symbolic debug info
> > and disabled optimizations.
[quoted text clipped - 12 lines]
>
> Oleg

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
mano - 07 Mar 2007 07:29 GMT
On Mar 6, 7:31 pm, "Oleg Starodumov" <com-dot-debuginfo-at-oleg>
wrote:
> > 1. I created a test VB6 Ocx control with create symbolic debug info
> > and disabled optimizations.
[quoted text clipped - 12 lines]
>
> Oleg

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
Oleg Starodumov - 07 Mar 2007 08:40 GMT
> 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.

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.

Also, previously you wrote:

> 1. I created a test VB6 Ocx control with create symbolic debug info
> and disabled optimizations.
[quoted text clipped - 3 lines]
> 4. Ran the VB6 ocx application
> 5. Then ran the VB.Net application

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
mano - 07 Mar 2007 09:38 GMT
> 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.

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
Oleg Starodumov - 07 Mar 2007 10:27 GMT
> > 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
[quoted text clipped - 11 lines]
> I have set break point in the ocx also but it is not hiting the break
> points of the ocx control.

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
mano - 07 Mar 2007 11:18 GMT
On Mar 7, 3:27 pm, "Oleg Starodumov" <com-dot-debuginfo-at-oleg>
wrote:
> > > 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
[quoted text clipped - 18 lines]
>
> Oleg- Hide quoted text -

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
Oleg Starodumov - 07 Mar 2007 11:44 GMT
> > 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
[quoted text clipped - 5 lines]
>
> How I have to step into VB6 ocx.

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
mano - 08 Mar 2007 12:19 GMT
On Mar 7, 4:44 pm, "Oleg Starodumov" <com-dot-debuginfo-at-oleg>
wrote:
> > > 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
[quoted text clipped - 13 lines]
>
> Oleg

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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.