According to System.pas, it is documented as True if compiled as console app
. In System.pas, there is also an assignment
{$IFDEF LINUX}
IsConsole := True;
...
I have a strange problem where an app is launched from a Delphi app, using ShellExecute, and then it runs into this code, raising the (unexpected) exception
if System.IsConsole then
raise Exception.Create(Msg)
The application is not compiled with Project/Options/Linking/Generate console application
. What else could set IsConsole to true?
Note that in Delphi XE2, OSX applications can not use this variable as it is always true. See QC Entry 98956 and Why Does My OSX FireMonkey App Think It Is a Console App ?
Found it: the executable has been created using dcc32.exe and the dpr / cfg file, the cfg contains a line
-cc
which creates a console application.
The Delphi 2009 Enterprise IDE does not show this setting in the Project/Options/Linking/Generate console application
dialog. The application was ported from an older Delphi version and maybe something went wrong over the years.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With