Debugging multiple VB apps at once

How do I debug more than one debug app at once?

In my main app I have a reference to an active X component.  I would like to debug the Active X (using my source code of course). I tried to set the referece path to the active X's vbp file...but it doesnt like that one bit.  How is this done?

Im stumped. :)

Who is Participating?
Éric MoreauConnect With a Mentor Senior .Net ConsultantCommented:
do exactly this and it will work

1. start a new VB instance

2. create a new ACTIVEX EXE project template

3. Add this procedure to the default class that has been created:
Option Explicit

Public Sub MyProc()
    MsgBox "Hello for ActiveX EXE!"
End Sub

4. add a breakpoint on the msgbox line

5. Press F5 (to run it).

6. start a new VB instance

7. create a new STANDARD EXE project template

8. Change your project name (or else you will get an error).

9. add "Project1" to your project references (the location should be set to something like c:\temp\vb7.tmp)

10. add a button to your form

11. add this code:
Option Explicit

Private Sub Command1_Click()
Dim x As Project1.Class1

    Set x = New Project1.Class1
End Sub

12. press F5 and click on the button

enjoy debugging!

BTW, it is often much easier to change the project type to ActiveX DLL for the debugging time and reset it to ActiveX EXE when debugging is complete.

Éric MoreauSenior .Net ConsultantCommented:
1. Open your component.
2. Into the same VB IDE instance, select File->Add Project... and select your second project
3. In the project explorer, right-click the second project and select "Set as start-up"
JohnnyKnoxvilleAuthor Commented:
When I open my main app....then add the second component to the same instance of the IDE.....I receive an error stating:

Project <path to my project>.vbp cannot be referenced because its project type is EXE.

I can select OK and then I click on the second project in the project explorer and select 'Set as start-up'.  Then I try to run the projects and nothing happens.  

Any Ideas?

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Éric MoreauSenior .Net ConsultantCommented:
Open your component FIRST. then your app can be opened and the set as startup must be applied to the EXE (not the component).
JohnnyKnoxvilleAuthor Commented:
Sorry for the confusion but can you clarify even more. :)

Ok....lets say my standard app (my main app) is app1 and my activeX .exe (component) is app2.  Im supposed to open app2....then app1...then set as startup to app2????


Éric MoreauSenior .Net ConsultantCommented:
I was thinking that you were building an ActiveX DLL (in which case the proc I gave you is correct).

For an ActiveX EXE,

1. Open your Component in one instance of VB and press start (or F5)

2. Open your main app into a SECOND instance of VB

3. Set your reference to the component and press start.

You will be able to debug both.
JohnnyKnoxvilleAuthor Commented:
Well...I opened the component app (active X exe) and started it.....

Then I opened my main app and refereced the vbp of the active X app....

Then I started my main app and set a break point in my active X app and nothin....hmmmmm.  

Am I just stuck in stupid?  or am I missin something else?

thanks a million for all of your help so far. :)

JohnnyKnoxvilleAuthor Commented:
Cool.....Sorry for taking so long to wrap this question up.  Thanks a million!

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.