Calling a vb.net project from vb6

cinners

New member
Joined
May 30, 2003
Messages
2
Location
Pennsylvania
I have an existing system that was develpoed in vb6.
On one of the froms there is to be a button that links to a new project that is written in vb.net.

How do I get the vb6 form and code in the click event of the button to load the new project written in vb.net??

Thanks cinners@state.pa.us
 
if you want to load the project ( as in open the exe and run it ) from vb6 , you can either use the " Shell " command , or the ShellExecute api.
eg:
Code:
Private Sub Command1_Click()
Shell "C:\your exe location", vbNormalFocus
End Sub

or

Code:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Const SW_SHOWDEFAULT As Long = 10

Private Sub Command1_Click()
ShellExecute 0, "open", "C:\your exe location", vbNullString, vbNullString, SW_SHOWDEFAULT
End Sub
 
Back
Top