Vb.net calling Vb6

netpicker9

Member
Joined
Dec 8, 2004
Messages
17
Programming Experience
1-3
HI,

I have a VB.net (2005) Application which is converted from Vb6 Application.

The Vb6 Application is calling another Vb6 Application on button click and performing some action, once the second application closes, the control is back to first Vb6 application.

Can I use / call Vb6 application from Vb.net application?

let say user information change screens I have in Vb6, and i want to call it from Vb.net.. Is it possible?

if so, once the Vb6 application closes, how to tell vb.net application that external application is closed?

I have code like this..

How to know when the called (Vb6) application is closed.

How to send a message or variable / value to vb.net application once vb6 appl is closed..

Right now i am doing like this,
VB.NET:
clsInfo - is a Class Module in Change.vbp (Vb6 Project) and it has method called 'Run'

addr = CreateObject("Change.clsInfo")

strUserID = ""

If addr.Run(strNo, strAccount, strUserID, CLng(1)) = 0 Then

MsgBox("ERROR: Unable to successful start Change Request Application", MsgBoxStyle.Exclamation)

frmMax.Show()

Me.Show()

Exit Sub

End If

Do

Select Case addr.intIsRunning

Case 0

'Not Success, highlight vb6 form again

Case 4

'Show Current Vb.net Form

End Select

Loop

Thanks
 
You can't call any application from a VB.NET application. Not even .NET applications. You can reference a COM library written in VB6 from a VB.NET application. If you create COM or ActiveX components in VB6 you can reference them and use them in VB.NET applications in essentially the same way as you do .NET assemblies, including those from the .NET Framework itself.
 
Hi

Hi,

The code i gave here, is working fine and opening VB6 Application, only problem is, once i close Vb6 application, the Vb.net application also closing..

and Vb6 application should return addr.intIsRunning, (See below VB6 Code)

i think its not returning a value to vb.net application...
Public Property Get intIsRunning() As Integer
intIsRunning = g_IsRunning
End Property

Suggest me..

Thanks
 
Back
Top