- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We have a tool has compiles Fortran files from command-line. We find it absolutely impossible to do any other work on the machine due to hundreds of "f90com.exe" DOS prompts appearing and taking focus. Is there any way to disable the popping up of these prompts?
Attached is a picture of the prompt. Note that the prompt contains no text and is absolutely useless.
Attached is a picture of the prompt. Note that the prompt contains no text and is absolutely useless.
Link Copied
8 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How does this tool spawn the command? I'm guessing that it's the tool that creates the window, at least implicitly - you don't see this happening when the compiler is invoked from the IDE.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, you are correct. Reproducing this behavior within the IDE or from within a DOS-shell appears to be impossible.
We have a Tcl/Tk application which invokes GNU make and pipes the output through "cat" into a "text" widget.
Within our makefile, we are compiling each fortran file with the following:
ifl /nologo /Qlowercase /us /Qfpp /DRECL_WORDS /Gm /w95
If you are familiar with Tk, here are the commands:
Where $makeText is the text widget
Where $command is the call to make
catch {open "|$command |& $cat" "r"} data(Make,pipe)
$makeText insert end $data(Make,pipe)
catch {$makeText see end}
update idletasks
We have a Tcl/Tk application which invokes GNU make and pipes the output through "cat" into a "text" widget.
Within our makefile, we are compiling each fortran file with the following:
ifl /nologo /Qlowercase /us /Qfpp /DRECL_WORDS /Gm /w95
If you are familiar with Tk, here are the commands:
Where $makeText is the text widget
Where $command is the call to make
catch {open "|$command |& $cat" "r"} data(Make,pipe)
$makeText insert end $data(Make,pipe)
catch {$makeText see end}
update idletasks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, you're out of my league here... I'd guess it has something to do with the way the "open" command creates the process to run the compiler, but that's about as far as I can take it.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think I know what the problem is. When the Intel developers compile the f90com.exe executable, do you link it such that the operating system runs it as a CONSOLE or WINDOWS? Under the MS Visual C++ compiler, this option is specfied via the /SUBSYSTEM command.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In addition, can you tell me how "ifl" invokes "f90com.exe"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Urm...
f90com.exe appears to be built with subsystem:console. This doesn't seem unreasonable to me for an application that writes to the console.
ifl invokes f90com.exe using _spawnvp
Steve
f90com.exe appears to be built with subsystem:console. This doesn't seem unreasonable to me for an application that writes to the console.
ifl invokes f90com.exe using _spawnvp
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've been able to create a stand-alone use case. An individual on the comp.lang.tcl newsgroup was kind enough to provide the explanation (which may I note appears in other applications which start without a console):
--- BEGIN EXPLANATION ---
When Windows starts a subprocess, it will try and attach it to a console unless the CreateProcess() call specifies that the child is "detached". Windows attaches the new process to the parent's console, if it has one; otherwise it creates a new console window for the child.
Wish (the interpreter for Tk) starts subprocesses as "detached" children, which means that they do not have a console. If the child (make, in your example) then starts another process but doesn't provide the detached flag, Windows will create a console for this grandchild process. The implementation of _spawnXX() in Microsoft's libraries does not normally provide the detached flag.
--- END EXPLANATION ---
To exercise this explanation, I wrote two applications. The 1st use case had the first application launch the second application using _spawnXX using a WISH. The behavior I see with "ifl" launching "f90com" was reproduced. Then I modified the first application to use CreateProcess instead. Since Windows was going to create the console regardless, I set a flag (SW_HIDE) in CreateProcess to not show the window.
How would I go about requesting for Intel to create an optional command-line for "ifl" (say /suppressSubconsoleWindowCreation) which would use CreateProcess (similar to the code below) instead of _spawnvp when launching f90com?
Here's my code for launching the application via CreateProcess instead of _spawnvp. Note that stdout, stdin, and stderr are inherited from the parent.
char command[] = "f90com.exe";
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
si.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
si.hStdError = GetStdHandle(STD_ERROR_HANDLE);
si.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
si.wShowWindow = SW_HIDE;
ZeroMemory(π, sizeof(pi));
// New process inherits handles from the calling process
if (!CreateProcess(NULL, command, NULL, NULL,
TRUE,
NULL, NULL, NULL,
&si, π)) {
//
// Big bad error
//
} else {
WaitForSingleObject(pi.hProcess, INFINITE);
}
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
--- BEGIN EXPLANATION ---
When Windows starts a subprocess, it will try and attach it to a console unless the CreateProcess() call specifies that the child is "detached". Windows attaches the new process to the parent's console, if it has one; otherwise it creates a new console window for the child.
Wish (the interpreter for Tk) starts subprocesses as "detached" children, which means that they do not have a console. If the child (make, in your example) then starts another process but doesn't provide the detached flag, Windows will create a console for this grandchild process. The implementation of _spawnXX() in Microsoft's libraries does not normally provide the detached flag.
--- END EXPLANATION ---
To exercise this explanation, I wrote two applications. The 1st use case had the first application launch the second application using _spawnXX using a WISH. The behavior I see with "ifl" launching "f90com" was reproduced. Then I modified the first application to use CreateProcess instead. Since Windows was going to create the console regardless, I set a flag (SW_HIDE) in CreateProcess to not show the window.
How would I go about requesting for Intel to create an optional command-line for "ifl" (say /suppressSubconsoleWindowCreation) which would use CreateProcess (similar to the code below) instead of _spawnvp when launching f90com?
Here's my code for launching the application via CreateProcess instead of _spawnvp. Note that stdout, stdin, and stderr are inherited from the parent.
char command[] = "f90com.exe";
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
si.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
si.hStdError = GetStdHandle(STD_ERROR_HANDLE);
si.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
si.wShowWindow = SW_HIDE;
ZeroMemory(π, sizeof(pi));
// New process inherits handles from the calling process
if (!CreateProcess(NULL, command, NULL, NULL,
TRUE,
NULL, NULL, NULL,
&si, π)) {
//
// Big bad error
//
} else {
WaitForSingleObject(pi.hProcess, INFINITE);
}
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page