Solved

Debugging multiple VB apps at once

Posted on 2002-03-15
8
308 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 69

Expert Comment

by:Éric Moreau
Comment Utility
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
Comment Utility
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 69

Expert Comment

by:Éric Moreau
Comment Utility
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
 

Author Comment

by:JohnnyKnoxville
Comment Utility
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
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
Comment Utility
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 69

Accepted Solution

by:
Éric Moreau earned 50 total points
Comment Utility
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
Comment Utility
Cool.....Sorry for taking so long to wrap this question up.  Thanks a million!



knoxxx
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now