Solved

Debugging multiple VB apps at once

Posted on 2002-03-15
8
311 Views
Last Modified: 2008-01-16
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. :)

knoxxx
0
Comment
Question by:JohnnyKnoxville
  • 4
  • 4
8 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6869386
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"
0
 

Author Comment

by:JohnnyKnoxville
ID: 6871832
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?

knoxxx
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6871865
Open your component FIRST. then your app can be opened and the set as startup must be applied to the EXE (not the component).
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

 

Author Comment

by:JohnnyKnoxville
ID: 6874471
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????



Thanks


knoxxx
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6874494
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.
0
 

Author Comment

by:JohnnyKnoxville
ID: 6879037
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. :)


knoxxx
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 50 total points
ID: 6879742
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
    x.MyProc
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.



0
 

Author Comment

by:JohnnyKnoxville
ID: 6888007
Cool.....Sorry for taking so long to wrap this question up.  Thanks a million!



knoxxx
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question