Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

quickwin piping

pikolo25
初學者
747 檢視
I am trying to pipe the contents of a .txt file into a Fortran QuickWin application. All attempts up to this point show that the QuickWin application ignores the contents of the pipe. Is there anyway to force it to recognize the contents of the pipe?
0 積分
4 回應
planejane5
初學者
747 檢視
Has anyone figured this out yet? I'm trying to do the exact same thing. I'm trying to use child windows, but I don't think this is helping. I wanted a simple solution so I don't have to rewrite my code to use dialogboxes or consoles.
Steven_L_Intel1
747 檢視
I would guess that you would need a thread on the Fortran side that reads the pipe and echos it using a Fortran WRITE statement. If you are expecting a QuickWin routine to read input from "standard input", it won't without your code that does it.
Jugoslav_Dujic
傑出貢獻者 II
747 檢視
QuickWin applications are actually a bast^H^H^H^H hybrid of Win32 and console applications. Actually, they are Win32 but they were "tweaked" by MS/DEC/Compaq/Intel to support "console" I/O like READ(*) and WRITE(*). However, you don't really get the same semanticsfor e.g. READ(*) in console and QuickWin app.
To expand on Steve's reply, GetStdHandle(STD_INPUT_HANDLE) retrieves the handle of file/pipe/console used for input. For Win32 applications, it is normally zero or a small, not quite meaningful value (smt. like 3).
If you did a CreateProcess for a QuickWin application with redirected hStdIn, I assume (didn't test it) thatGetStdHandle(STD_INPUT_HANDLE) willretrieve a handle set by CreateProcess; you can test it by GetFileType on returned (pipe) handle. If it's true, READ(*) won't work, but you can use ReadFile on it, and then pass the read contents to WRITE(*).
Note that QuickWin already has two threads -- PROGRAM runs in one, while all the menu and mouse callback run in another. Since PROGRAM is usually terminated with DO WHILE(1)...SLEEPQQ...ENDDO, you could put your "listening" code (ReadFile) there.
Jugoslav
Steven_L_Intel1
747 檢視
To the best of my knowledge, QuickWin doesn't try to attach itself to stdin/stdout at all. It is hooked into the Fortran I/O system, and when you do a WRITE to a unit that is opened to a QuickWin window, it diverts the data into the QuickWin system. There is no console at all. If there is a stdin/stdout handle, I don't think QuickWin looks at it at all.
I may be mistaken on some part of this, but I'm fairly certain you can't "pipe" into or out of QuickWin without going through Fortran READ/WRITE.
回覆