473,382 Members | 1,420 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Cross IDE Debugging - VB.Net to VB6

I'm sure you'll look at this question and wonder if I've been sniffing
glue. I haven't, really.

My legacy app is written in VB6 and we're chipping away at converting it
to .Net. I badly need to be able to step from VB6 IDE into a running
VB.Net session to debug the .Net component. This is trivial if I'm
running a compiled VB6 app, but that doesn't get me what I need.

Can I cross the IDE boundary like this?

Sean
Nov 21 '05 #1
5 6188

"Sean Kirkpatrick" <na**********@community.nospam> wrote in message
news:%2***************@TK2MSFTNGP14.phx.gbl...
I'm sure you'll look at this question and wonder if I've been sniffing
glue. I haven't, really.

My legacy app is written in VB6 and we're chipping away at converting it
to .Net. I badly need to be able to step from VB6 IDE into a running
VB.Net session to debug the .Net component. This is trivial if I'm running
a compiled VB6 app, but that doesn't get me what I need.

Can I cross the IDE boundary like this?


Yes. In VB.NET just attach to the VB6 IDE's process.

David
Nov 21 '05 #2
Sean Kirkpatrick wrote:
I'm sure you'll look at this question and wonder if I've been sniffing
glue. I haven't, really.

My legacy app is written in VB6 and we're chipping away at converting it
to .Net. I badly need to be able to step from VB6 IDE into a running
VB.Net session to debug the .Net component. This is trivial if I'm
running a compiled VB6 app, but that doesn't get me what I need.

Can I cross the IDE boundary like this?

Sean


Never tried it that way, but if you launch your VB6 app and then go to
Visual Studio and choose Tools -> Debug Process. Attach to the VB6
process and you should be able to put a break point in your .net app.

Chris
Nov 21 '05 #3
Sean,

"Sean Kirkpatrick" <na**********@community.nospam> schrieb:
My legacy app is written in VB6 and we're chipping away at converting it
to .Net. I badly need to be able to step from VB6 IDE into a running
VB.Net session to debug the .Net component. This is trivial if I'm running
a compiled VB6 app, but that doesn't get me what I need.

Can I cross the IDE boundary like this?


Yes, that's actually possible. Just create your VB6 project and your VB.NET
projects (a class library, for example) and reference the VB.NET project
from your VB6 project. Create a debug build of your VB.NET project.

To debug the projects together, open both projects, the VB.NET class library
project in VS.NET and the VB6 project in the VB6 IDE. Set breakpoints in
the class library project. Then start the VB6 EXE project from within the
VB6 IDE. Switch to VS.NET and choose "Debug" -> "Processes..." and select
"VB6.EXE". If the VB6 application is not started from within the IDE,
choose its EXE file from the list. Now you can debug the VB.NET class
library within VS.NET. If execution reaches a breakpoint, for example, it
will be highlighted in VS.NET and execution will be stopped until you
continue execution.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4
Thanks all - I see how it's done. Unfortunately, both IDEs crash when I
try to step into the .Net project. I submitted a crash report and MS
says that the problem is most likely caused by the .Net Framework 1.1. I
installed the lastest .Net service pack but nothing changed. :(

Sean
Herfried K. Wagner [MVP] wrote:
Sean,

"Sean Kirkpatrick" <na**********@community.nospam> schrieb:
My legacy app is written in VB6 and we're chipping away at converting
it to .Net. I badly need to be able to step from VB6 IDE into a
running VB.Net session to debug the .Net component. This is trivial if
I'm running a compiled VB6 app, but that doesn't get me what I need.

Can I cross the IDE boundary like this?

Yes, that's actually possible. Just create your VB6 project and your
VB.NET projects (a class library, for example) and reference the VB.NET
project from your VB6 project. Create a debug build of your VB.NET
project.

To debug the projects together, open both projects, the VB.NET class
library project in VS.NET and the VB6 project in the VB6 IDE. Set
breakpoints in the class library project. Then start the VB6 EXE
project from within the VB6 IDE. Switch to VS.NET and choose "Debug" ->
"Processes..." and select "VB6.EXE". If the VB6 application is not
started from within the IDE, choose its EXE file from the list. Now you
can debug the VB.NET class library within VS.NET. If execution reaches
a breakpoint, for example, it will be highlighted in VS.NET and
execution will be stopped until you continue execution.

Nov 21 '05 #5
Hi

I assume you are call .NET exposed COM object from vb6.
I think you may try to follow the steps below debuging vb6 app in vs.net.
1. Compiled the VB6 with Create Symbols
2. Set the Startup program when debugging for the VB.NET dll with the VB6
project1.EXE and check the unmanaged debugging option in the project
setting.
3. Open the Form1.frm in the vb.net IDE
4. Set break point in the Form1.frm's code line
5. F5 to run the VB.NET DLL project, because we have set the VB6
project1.EXE as the start up program, it will be run to hit the break point
in the Form1.frm
e.g.
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3090
ClientLeft = 60
ClientTop = 450
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3090
ScaleWidth = 4680
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 495
Left = 1800
TabIndex = 0
Top = 1320
Width = 1215
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim o As New TestCrossDebugVB6.MyTestClass
Dim s As String
s = o.TestString() 'If we set break point here, it will be hit when we
click Command1
MsgBox s
End Sub

[VB,NET]
Imports System.Runtime.InteropServices
<ClassInterface(ClassInterfaceType.AutoDual)> _
Public Class MyTestClass
Public Function TestString() As String
Return "Hello World"
End Function
End Class
You may have a try.
Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Java script Dude | last post by:
To all Mozilla JS Guru's (IE dudes welcome), I have spent the last three years developing complex DHTML applications that must work in IE 5.5sp2+ but I use Mozilla 1.3+** to do all my...
0
by: matsla | last post by:
I have followed all guide lines to set up remote debugging but is it possible to do cross-domain remote debugging? I use same account/password on both computers (XP => 2003), added users to debug...
6
by: Brian Bischof | last post by:
I'm having troubles getting the debugging process to work consistenly for external classes. I got it to work once and then I turned it off. But now I can't get re-enabled. Here is what I'm doing....
4
by: Mau Kae Horng | last post by:
Hello, I have a C# Windows Forms application for machine. Due to some unknown reasons, the application face problems with unexpected exceptions happening, resulting in two red lines forming a...
6
by: Jeremy | last post by:
I really want to make my scripts work in Opera. I really, really do. But it seems like an uphill struggle. First of all, I can't get ANY kind of debug output. No error messages in the...
10
by: Doug Robertson | last post by:
First off, I'm a hardware/OS guy. I just write code on the side and I'm completely self taught - so bear in mind my total lack of expertise. I have a program originally written in VB2003 using...
10
by: Christopher Nelson | last post by:
I've been developing a little web page full of JavaScript while using Firefox and it works well but when I try to view it in Opera and IE, it's incomplete. I suspect cross-browser issues in the...
8
by: Maikon Araujo | last post by:
Helo everybdy, I would like to ask if there is any way to debug ( I am trying MingW-gdb) a dll compiled with Mingw g++ witch is being used by Microsoft Excel application. Has anyone had problems...
3
by: Yves Gagnon | last post by:
Hi, I try to debug a WCF hosted in a windows services on a serveur that is on an other domaine then my developpement machine. I tried many things without succes. Here is what I tried: First I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.