|
-
Feb 3rd, 2006, 08:20 AM
#1
Thread Starter
Addicted Member
Passing data between two .EXE files
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
-
Feb 3rd, 2006, 08:32 AM
#2
Re: Passing data between two .EXE files
The two ways that come immediately to mind are either via a text file or a database entry.
-
Feb 3rd, 2006, 08:35 AM
#3
Re: Passing data between two .EXE files
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?
-
Feb 3rd, 2006, 08:41 AM
#4
Re: Passing data between two .EXE files
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.
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Feb 3rd, 2006, 08:51 AM
#5
Thread Starter
Addicted Member
Re: Passing data between two .EXE files
I see , well good idea , it's working allright
Shuja , what is the command line I have to use if I own the EXEs ?
-
Feb 3rd, 2006, 08:57 AM
#6
Re: Passing data between two .EXE files
 Originally Posted by bomayed
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.
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.
Code:
Debug.Print Command$
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 TEST1
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Feb 3rd, 2006, 11:07 AM
#7
Re: Passing data between two .EXE files
You can pass data between two running Apps with the WM_COPYDATA message.
http://www.vbforums.com/showthread.php?t=370564
-
Feb 3rd, 2006, 11:33 AM
#8
Frenzied Member
Re: Passing data between two .EXE files
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.
-
Feb 3rd, 2006, 11:45 AM
#9
Re: Passing data between two .EXE files
Did anyone suggest WinSock?
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
-
Feb 5th, 2006, 12:29 AM
#10
Re: Passing data between two .EXE files
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|