How do I pass data from one exe file to another exe file ?
Example :
TEST1.EXE will send the value ( 123) to TEST2.EXE
TEST2.EXE will use this value and do some stuff
Printable View
How do I pass data from one exe file to another exe file ?
Example :
TEST1.EXE will send the value ( 123) to TEST2.EXE
TEST2.EXE will use this value and do some stuff
The two ways that come immediately to mind are either via a text file or a database entry.
Hmmmmmmm..... I don't think that THAT is possible, but then I'm not sure.
What you could do is write the values to a *.txt. When the other *.exe opens it should read the value of the *.txt.
Simple example:
Exe1.exe writes 123 to *.txt
Shell "C:\Exe2.exe" Calling other Exe.exe
Exe2.exe Form_Load()
LabelInput.Caption = value *.txt = 123
Select Case LabelInput.Caption
Case 123
Action
Case Else
Other Action
End Select
You understand what I'm trying to tell?
As already suggested, you can use Text Files as a common saving point.
There can be one more way. If you are owning both the EXEs then you can have TEST2 accept a commanline parameter. Once that is done then you can call TEST2 from TEST1 using Shell and pass 123 as a CommanLine Parameter. TEST will internally use it in whatever way it is supposed to.
I see , well good idea , it's working allright
Shuja , what is the command line I have to use if I own the EXEs ?
Command Line parameter is what you pass in the Command Line. In Dir /AD /AD is the Command Line parameter passed to DIR. Same way you can have the TEST2 also accept the command line parameter. In VB we use Command$ to get the command line parameter.Quote:
Originally Posted by bomayed
If you have the source code of both the EXE's then you can simply modify code of TEST2 exe to handle Command Line Parameters.The above line will show the command line parameter that was passed to the exe. Once you have done the changes in the TEST2 then you can call it like this from TEST1Code:Debug.Print Command$
Code:Shell "TEST2 123"
You can pass data between two running Apps with the WM_COPYDATA message.
http://www.vbforums.com/showthread.php?t=370564
Since it's VB6 you can use DDE, it's built right into text boxes. You just set the LInkItem and LinkTopic. Been a while since I done it, but it's an easy & slick way to do it. Give it a shot.
Did anyone suggest WinSock?
or DCOM?