Using CreateProcess

Using CreateProcess

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?

4 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项
Steve Lionel (Intel)的头像

I don't see how you can - the QuickWin window is NOT a console window, even though it may look like one.

Steve

Steve

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.

Steve Lionel (Intel)的头像

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

Steve

登陆并发表评论。