views:

1007

answers:

3

Is it possible to remotely debug a process started outside VB6?

The application is a VB6 application with quite a few dll/ocx resources. I am attempting to setup a ClickOnce deployment, using Registration-Free COM, of the VB6 app but have been getting errors when it executes.

My understanding of the way that VB6 redirects COM registerations will probably mean that this is not possible but I thought someone might have a better idea.

+1  A: 

I believe that when debugging in VB6, it does not attach to a running binary but instead interprets the code within it's own process. This is why the Task Manager and Win32 APIs show VB6.exe as the running app when debugging.

Also as you say, VB6 sometimes short-circuits calls to COM libraries so intercepting these calls is not always possible.

You're probably going to have to resort to intelligent logging (i.e. log the values of variables around the points where the errors you are getting occur in the hope of locating the line of code it occurs on, and/or the state of relevant variables.)

Good luck

Merak
Logging was the path that I assumed I was going to have to take. Just wasn't looking forward to retro fitting a lot of extra logging to an existing app.
benPearce
+3  A: 

Have you tried windbg? Just make sure you have pdb files for the project.

Darryl Braaten
+3  A: 

To support Darryl's answer suggesting Windbg - here's a 2006 blog post by a Microsoft guy about using Windbg with VB6, and 2004 blog post by another Microsoft guy with a brief introduction to Windbg.

EDIT: Just to make it totally clear. Windbg is a free standalone debugger from Microsoft. Compile your VB6 EXEs, DLLs and OCXs into native code with symbols (create PDB files) and you will be able to debug your ClickOnce application.

MarkJ