I've already know how to call an external program with the shell command in vb6.
But is there a way of getting a result/feedback to the memory, for instance, of that external program back into vb?
Writing to a file is complicated if the program is running in a cd/dvd.
Last edited by jmsrickland; Aug 20th, 2014 at 10:43 AM.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
I agree. There are many factors to consider, and no one best solution.
Maybe this second program is written by somebody else, limiting your options. Or perhaps you only need to pass a small amount of data to that program via the command line, and then maybe know when it has terminated.
Or maybe this slave program doesn't need much input but must produce and send back a large amount of "results" data. Or perhaps the two programs need to have an ongoing give and take of requests and results.
If these two programs live on removable read-only media you have a problem to just begin with. VB6 doesn't offer any build options to create programs safe to run from such media or from network shares for that matter. Of course you can set the necessary flags through the use of EditBin.exe or Link.exe after compiling.
Even if you deal with that you can't use the obvious approach: make the slave program an ActiveX EXE. It is never safe to register components that aren't on a local hard drive, and registration would be a requirement.
There are tons of other IPC alternatives though. Each has advantages and disadvantages.
Sorry, I had to go out.
The exe program I'm calling, is mine - I made it in Perl because of the advantages of this language in some circumstances.
Either way, I think I've found the solution - I'll post it here as soon as I test it.
Oh, thanks for the ocx.
Have you given any thought to using sockets. In VB you would use Winsock and I'm sure Perl has it's own socket controls.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
Better yet, if you must use Perl you can just run it inside the VB6 program.
The Microsoft Script Control works fine with Perl if you install an appropriate scripting engine such as ActivePerl. There is a free personal use "community license" version as well as a commercial license version in the ($$) "Perl Dev Kit."