[Feature Request] Please use WinAPI's OutputDebugString for WriteLn on Windows GUI apps
Original Reporter info from Mantis: Buttercup5000
-
Reporter name: Will B
Original Reporter info from Mantis: Buttercup5000
- Reporter name: Will B
Description:
When attempting to use WriteLn without an open file on GUI apps on Windows, an 'EInOutError: File not open' exception displays. This limitation is already mentioned in the wiki, but not the documentation. If Free Pascal could be changed to use WinAPI's OutputDebugString() method on Windows, then tools such as Sysinternal's DebugView could be used to display WriteLn output without needing extra units, packages or tools.
Steps to reproduce:
Compiling and running the following program as a GUI app on Windows causes the 'File not open' exception:
Compile command-line: fpc -WC- example.pas
- - -
Program example;
Uses sysutils;
begin
WriteLn('This is a test');
end.
- - -
Additional information:
Again, I am aware that this is a known limitation on Windows. Changing WriteLn to use OutputDebugString() on Windows would help Free Pascal function more like it does on Linux, BSD, etc and be a huge help for Windows users who would like to use WriteLn for debugging purposes.
Mantis conversion info:
- Mantis ID: 37689
- OS: 7 & 10
- OS Build: 64-bit
- Build: 2020/07/07
- Platform: Windows
- Version: 2.3 (SVN)
- Monitored by: » Buttercup5000 (Will B)