I need to pass a variable from one stand alone program to another. How do I set up a command line for this. i have written both of these programs so there isn't anything already built in to accept the variable.
i have written both of these programs so there isn't anything already built in to accept the variable.
If that's the case why not modify the sources to handle this?
What is the state of the applications when you need to pass data from one to another? Are they both running or will the sender app Shell the receiver app when it needs to send?
If it's the second, you can simply pass the data as command line parameters and in the receiver app grab it using the Command function. If both are running then you have several methods, like using shared files, named pipes, even maybe SendMessage API. It really depends a lot on circumstances and what data is to be transfered.
If it does the job using the command line is the best bet.
For ongoing communication there are many answers. In addition to those mentioned there are also DDE and Mailslots.
I just happen to have a fresh Mailslots demo on hand. See the notes.txt in the archive. There is a "main" Client program and two Server "sub" programs.
The first program that needs to pass the variable, will already be running. It needs to pass the path to the database to the second program, that will be shelled by the first program. Can you either point me in the direction to get code or send me something. I have never seen this before.
I know you have me going in the right direction but I seem to keep going down the wrong trail. nothing I have read tells me how to pass a variable in a shell command, only command line passing. It looks like the requirements are different.
With this:
Dim strDBPath As String
strDBPath = "You did it"
Shell "E:\Dexter\Print Page\Project1.exe" & strDBPath
I get a file not found error
With this:
Dim strDBPath As String
strDBPath = "You did it"
Shell "E:\Dexter\Print Page\Project1.exe & strDBPath"
It opens the Project1.exe and puts "strDBPath" in the text box i have to capture the variable.
This is what i have in the form load of Project1.exe:
Dim strDBPath As String
strDBPath = Command
Text68.Text = strDBPath