Results 1 to 9 of 9

Thread: [RESOLVED] Controlling EXE to EXE communication

  1. #1

    Thread Starter
    Member
    Join Date
    May 2010
    Posts
    58

    Resolved [RESOLVED] Controlling EXE to EXE communication

    Hi guys,

    I have a question about controlling a EXE file that is written in VB, using another VB program.
    Let's say my final point is to communicate with C (an EXE file written in another language, doesn't matter!).

    To do that I wrote a VB (exe) script that is piped to C, and can get back the result in itself, I call it B.
    Now my main program that calls B, is 'A'. (B communicates to C).

    Now the problem is as you can see its being too much complicated and so is the debugging. My question is, when I run my code 'A', then call 'B' from it, it doesn't show any of the forms of 'B', but B has an interface with all the details that I need. I know that it's doing it's job (I can get the results back with no problem), and eventually I don't even want it to appear, but now for debugging it's really annoying to not see what's happening.

    Can anybody here help me with this issue? A good solution would be to know how to make B appear and show it's process (each run of B takes at least 15 seconds).

    I know that logging to a text file is an option, but that would be my last option as its way easier if the B's VB interface would just shows up!


    Sincerely,
    Luinox86.

  2. #2
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: Controlling EXE to EXE communication

    How are you invoking B from A?

  3. #3

    Thread Starter
    Member
    Join Date
    May 2010
    Posts
    58

    Re: Controlling EXE to EXE communication

    Using:

    Shell ("c:\b.exe the_parameter")

  4. #4
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: Controlling EXE to EXE communication

    If B is a VB Application, is the form's Visible property set to True ? If not, you should set it. You should then see application B's user interface when it is shelled.

  5. #5

    Thread Starter
    Member
    Join Date
    May 2010
    Posts
    58

    Re: Controlling EXE to EXE communication

    I think it's already set to True, I will double check again, but when I run it from the VB IDE there is no problem. Thanks, I will check it and get back to you.

  6. #6
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: Controlling EXE to EXE communication

    I wonder if you also need vbNormalFocus (I don't know what the default is if there is one)
    Code:
    Shell ("c:\b.exe the_parameter", vbNormalFocus)

  7. #7

    Thread Starter
    Member
    Join Date
    May 2010
    Posts
    58

    Re: Controlling EXE to EXE communication

    I already tried vbNormalFocus and the feature: Visible. Both are set, but still it doesn't appear.

    I just thought of something, from the very beginning lines of the Form Load of B, I am calling the other program, C. Maybe I would need to use a DoEvents right before and after calling C.

    What do you think? I will try and inform you in a couple of hours.

  8. #8
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: Controlling EXE to EXE communication

    I wouldn't have thought so. If C's user interface is being displayed it will probably be on top of B's.

    Perhaps B is actually running faster than you think and starts and finishes in the blink of an eye, I guess you could comment out the call to C and see if B gets displayed. If it's working from the IDE then its either that or something about the Shell. (I never use Shell myself)

    Off to work now, will check back later to see how you are getting on.

  9. #9

    Thread Starter
    Member
    Join Date
    May 2010
    Posts
    58

    Re: Controlling EXE to EXE communication

    Thanks Doogle and others,

    The problem is solved. Apparently since at the form load of B I was calling C, B wouldn't have the time to show up, I just added a Main.show at the very first line of B and its good to go!

    Sincerely,
    Luinox86.

Tags for this Thread

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