Software Archive
Read-only legacy content
17060 Discussions

Using CreateProcess

richpauir
Beginner
294 Views
I am trying to get a console application to display and run in the same window as a parent quickwin application. I am using the code below:

StartupInfo = T_STARTUPINFO(SIZEOF(StartupInfo),0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
print *,'What is the name of the executable to run?'
read '(a)',exec_name
ret = CreateProcess (NULL_CHARACTER, exec_name, null_security_attributes, null_security_attributes, true, 0,null, null, startupinfo, processinfo)

Whenever I complie and run my quickwin application, the console applicaiton that I call starts in it's own window. I want it to use the parent window. Any suggestions?
0 Kudos
3 Replies
Steven_L_Intel1
Employee
294 Views
I don't see how you can - the QuickWin window is NOT a console window, even though it may look like one.

Steve
0 Kudos
richpauir
Beginner
294 Views
Here's exactly what I'm trying to do. My boss has developed several fortran executables as console applications. These executables accept and output text to and from the user.
I need to develop a windows based executable that can serve as an interface for any of my boss's executables. He'd like to be able to start my window's based exe and call any of his executables and have the input/output displayed in my exe's window (i.e. no independent console window for his executable is created). My problem is that my code still causes a separate console window to be created for my boss's executable.
0 Kudos
Steven_L_Intel1
Employee
294 Views
You'll have to create two pipes and redirect the boss' program input and output to the pipes. Then in your main program, have threads that send input to the in pipe and read it from the out pipe, displaying the output using Fortran I/O in the QuickWin window. You can specify the pipes in your call to CreateProcess.

Steve
0 Kudos
Reply