Pass Values to an VB6 exe

slim

New member
Joined
Feb 21, 2004
Messages
2
Location
UK
Hi,

I wonder if you can help me, bascially we have a crystal report viewer application written in VB6. When the execuatble is launched from one of our software programs it is passed three values (see below).

Option Explicit
Public strDataSource As String
Public strInitCatalog As String
Public lngReportID As String

The question is how to I start the VB6 application and pass the three values to the application from my New VB .NET appication (just like our other software does).

Thanks for our help

Slim
 
The System.Diagnostics.Process class and its Start method accept an exe path and arguments that you pass in to it. You can start your application like that and the arguments will be passed in.
 
In case you need the alternative way. SetWindowText API would help. This is a dirty trick, but it works perfectly. Its much better than old DDE.

1. Put an invisible text box in VB6s main form. Use this text box to receive strings from your vb.net app.

2. Send the strings to the text box in your vb6 app by using SetWindowText API.

3. Changed event of the text box will raise whenever there are strings received.

Note: you will also use other simple APIs to get the hWnd of the textbox. Good Luck! :D
 
Last edited by a moderator:
Back
Top