Solved

Debugging multiple VB apps at once

Posted on 2002-03-15
8
310 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
ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to Add / Edit Windows Menu 4 61
Spell Check in VB6 13 114
I need help embedding an image as HTML in my vb.net application 3 69
Zip Folders Using Chilkat Routines 1 41
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

803 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