Results 1 to 10 of 10

Thread: Calling another EXE and receiving data back

  1. #1

    Thread Starter
    Member docHoliday's Avatar
    Join Date
    Sep 1999
    Location
    Stamford, CT, USA
    Posts
    48

    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

  2. #2
    Matthew Gates
    Guest
    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.

  3. #3

    Thread Starter
    Member docHoliday's Avatar
    Join Date
    Sep 1999
    Location
    Stamford, CT, USA
    Posts
    48
    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

  4. #4
    Junior Member
    Join Date
    Aug 2001
    Posts
    23

    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

  5. #5

    Thread Starter
    Member docHoliday's Avatar
    Join Date
    Sep 1999
    Location
    Stamford, CT, USA
    Posts
    48
    Winsock huh? Interesting copncept. I'll give it a whirl.
    "A balm? That's a dangerous animal. Throw it in the trough!"
    - Monty Python

  6. #6
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    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..

  7. #7

    Thread Starter
    Member docHoliday's Avatar
    Join Date
    Sep 1999
    Location
    Stamford, CT, USA
    Posts
    48
    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

  8. #8
    Addicted Member RCharlton's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    202

    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
    Richard Charlton

    VB 6.0, Java 2.0, C++, PHP, Perl, HTML, Javascript

  9. #9

    Thread Starter
    Member docHoliday's Avatar
    Join Date
    Sep 1999
    Location
    Stamford, CT, USA
    Posts
    48
    How do you read STDIN within VB?
    "A balm? That's a dangerous animal. Throw it in the trough!"
    - Monty Python

  10. #10

    Thread Starter
    Member docHoliday's Avatar
    Join Date
    Sep 1999
    Location
    Stamford, CT, USA
    Posts
    48
    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
  •  



Click Here to Expand Forum to Full Width