Reputation: 1033
Imagine that when i start application #0, it makes some calculations and after some time it starts application #1, application #2, application #3. (It sends some arguments, object to new applications.).
I want to debug application #1 but it must be started from application #0.
How can i do this? (I'm using Visual Studio 6 & i have the source code & everything about these applications)
Upvotes: 3
Views: 1818
Reputation: 15774
Read this article which describes how to debug an ActiveX exe
Basically you will run the ActiveX exe, then add a reference to it in the calling application. Leave the ActiveX exe running because the reference is to its running process, not to its compiled exe. Now run the calling application as well. This will allow you to stop on breakpoints in separate instances of visual studio.
It has been a while but I wanted to make sure I could do it myself, and I can confirm it works. So here it is:
Make a new project called Project1. It will be the ActiveX EXE
You should have a file called Class1, where you will put this code:
Option Explicit
Public Function Foo()
MsgBox "foo"
End Function
Now make another project called Project2. This is a standard EXE
Start Project1. This prompt asks what to do when the project starts. Choose "Wait for components to be created". Click ok and leave it running.
Go to Project2, Project Menu >> References. Find Project1 in the list. Tick the checkbox. (Do not browse the file-system to Project1 at this point, just use the temporary binary in the available references list!)
Now enter this code in Project2.Form1
Option Explicit
Private Sub Form_Load()
Dim p As New Project1.Class1
p.Foo
End Sub
You may put a breakpoint in Project1.Class1.Foo() on the msgbox line. This breakpoint will be hit when you run Project2.
The reference you added is strictly used for debugging. When deploying your application, you should copy the ActiveX exe binaries to your application directory and reference those files directly.
Upvotes: 5
Reputation: 5468
Microsoft has published a couple of articles somewhat related to this, but it states that you have to start VB6.exe as the child process instead of your compiled VB6 program.
Upvotes: 0