Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can GUI respond to events in another program? 9

Status
Not open for further replies.

ctlin

Technical User
Apr 17, 2002
77
0
0
US
i'm trying to build a front end for a fortran program. you guys helped me get info going from VB into the fortran program yesterday... is there anyway it can go the other way?
is there such thing as having a Fortran program trigger a system event at certain points during execution and VB responding to those? what i need is a way for VB to know when it needs to send input to Fortran. Thanks in advance
 
Sure - just do:

WriteConsoleIO ""

(the particular code example presented way above always tacks vbCRLF onto any line of text you send; so sending an empty string in practice actually sends a carriage return and a linefeed)
 
also, is there any way to "see" what is going on in the console app? sometimes my console app exits while the vb is still running and I can't tell. thanks.
 
Do you mean monitor the active status of other applications using the redirected VB console? As opposed to simply monitoring their console output?
 
I meant to say that, if the former, you need to look at an API call called GetConsoleProcessList, which returns a list of all the processes attached to a console, or play with WinEventProc looking for EVENT_CONSOLE_END_APPLICATION.

Have fun...
 
the problem was that i couldn't tell if the console prog had exited or if it wasn't responding to prompts. i'll look into that API call. thanks.
 
I am trying to get this to execute DOS commands (ROUTE, IPCONFIG, ARP) and am having problems capturing the response, any ideas. . .

Thx in advance
 
OK, I think I got it, the only problem I am now running in to is the SLEEP time. I am trying to figure out if there is a way to know when the command is complete.

Thx
 
Hi,

I am doing something similar using the code given by strongm above. I changed the name of the batch file. When I try to run, it hanges and later when I close gives a memory exception and closes. It is working fine for the batchfile specified in the code. Please can someone suggest what needs to be done ?
My batch file is called run.bat and is running fine from cmd window. Please advice.
 
I am posting here because I want this to be a part of my library of links which I have responded to. Strongm has done it again! WOW! What a guy...

LF

"As far as the laws of mathematics refer to reality, they are not certain; as far as they are certain, they do not refer to reality."--Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top