|
-
Sep 4th, 2001, 08:46 PM
#1
Thread Starter
Member
Calling another EXE and receiving data back
I'd like to know if it is possible in VB to write a function that calls a seperate exe on the local hard drive sending it data and arguments like a path, having it do its work, then return data back to the VB program to process. I'm sure this is a complicated process but I'm mainly looking for direction, and possibly examples on how to accomplish it.
Thanks.
"A balm? That's a dangerous animal. Throw it in the trough!"
- Monty Python
-
Sep 4th, 2001, 10:24 PM
#2
It depends. If the other exe was made by you, you can use the Command function and have it do stuff and write the information to a text file. If not, than you'd have to maybe use a few API functions to get what the program does, may not be accurate though, not sure, depending on what you are wanting to do.
-
Sep 4th, 2001, 10:43 PM
#3
Thread Starter
Member
Well I can't say for sure at the moment exactly how the program expects to receive information and/or arguments nor how it returns them, but I know it normally does this interaction with a web server.
"A balm? That's a dangerous animal. Throw it in the trough!"
- Monty Python
-
Sep 4th, 2001, 10:48 PM
#4
Junior Member
Use winsock maybe?
Try using winsock to do the comm.
Have one app be a server, the other be a client, and then make them send data to be processed thru winsock - easy enuf
-
Sep 5th, 2001, 11:32 AM
#5
Thread Starter
Member
Winsock huh? Interesting copncept. I'll give it a whirl.
"A balm? That's a dangerous animal. Throw it in the trough!"
- Monty Python
-
Sep 5th, 2001, 11:45 AM
#6
If both programs are yours then I would suggest using external program as ActiveX EXE, you can then create an instance of your ActiveX EXE, pass paramters and get the result back..
-
Sep 5th, 2001, 11:52 AM
#7
Thread Starter
Member
The program I want to communicate with is not one of my own. It's an externally written and produced program. I'm kind of alluding to it's name I know, which would proably help a lot, but I'm kind of keeping that under tabs for the moment.
Surfice to say this: It normally runs with a web server running, either Apache, IIS or other. It can be run as a CGI executable or within the server process and I'd like to access it as if it were a CGI executable. Does that help any?
"A balm? That's a dangerous animal. Throw it in the trough!"
- Monty Python
-
Sep 5th, 2001, 12:00 PM
#8
Addicted Member
One thing to do would be to
print to read STDIN - if it is to do with Apache - some kind of scripting etc. it may well write the results to STDIN
-
Sep 5th, 2001, 02:38 PM
#9
Thread Starter
Member
How do you read STDIN within VB?
"A balm? That's a dangerous animal. Throw it in the trough!"
- Monty Python
-
Sep 5th, 2001, 11:45 PM
#10
Thread Starter
Member
Could STDIN -> STDOUT be accomplished with the WinSock control?
"A balm? That's a dangerous animal. Throw it in the trough!"
- Monty Python
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
|