|
-
Aug 25th, 2011, 03:12 AM
#1
Thread Starter
Member
[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.
-
Aug 25th, 2011, 03:16 AM
#2
Re: Controlling EXE to EXE communication
How are you invoking B from A?
-
Aug 25th, 2011, 03:29 AM
#3
Thread Starter
Member
Re: Controlling EXE to EXE communication
Using:
Shell ("c:\b.exe the_parameter")
-
Aug 26th, 2011, 02:16 AM
#4
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.
-
Aug 26th, 2011, 02:22 AM
#5
Thread Starter
Member
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.
-
Aug 26th, 2011, 02:28 AM
#6
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)
-
Aug 26th, 2011, 02:34 AM
#7
Thread Starter
Member
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.
-
Aug 26th, 2011, 02:42 AM
#8
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.
-
Aug 29th, 2011, 08:58 PM
#9
Thread Starter
Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|