Results 1 to 8 of 8

Thread: Getting feedback from shell

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2011
    Posts
    108

    Getting feedback from shell

    Hi,

    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.

    Kind regards,

    JKepler

  2. #2
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,145

    Re: Getting feedback from shell

    Quote Originally Posted by jkepler View Post
    Hi,
    Writing to a file is complicated if the program is running in a cd/dvd.
    JKepler
    Why? Am assuming you are writing to your harddrive.

  3. #3
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Getting feedback from shell

    Try using this ShellPipe User Control.
    Attached Files Attached Files
    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.

  4. #4
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Getting feedback from shell

    It would help if you told us what it is you are trying to do and what problem you are having.

    What you can get from a program varies greatly depending on the program in question.

  5. #5
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Getting feedback from shell

    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.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Mar 2011
    Posts
    108

    Re: Getting feedback from shell

    Hi,

    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.

    Kind regards,

    JKepler

  7. #7
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Getting feedback from shell

    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.

  8. #8
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Getting feedback from shell

    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."

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