digitalmars.D.learn - Win32: Console in GUI application
- Andrew Fedoniouk (17/17) Mar 18 2005 In MS C++ I can create console window (e.g. for debugging purposes)
- Charles (4/21) Mar 19 2005 -Lexet:NT for the linker
In MS C++ I can create console window (e.g. for debugging purposes) by using this: AllocConsole(); freopen("conin$", "r", stdin); freopen("conout$", "w", stdout); // <- here is Win32 Exception exception in D freopen("conout$", "w", stderr); The same trick in D generates Win32 Exception on third line. I did test also freopen("con", "w", stdout); approach with the same negative result. In fact I've solved this problem for myself by just not including .def file in the project - so it runs as a console app from the very beginning. But I would like to provide an option in runtime - on/off console. Any ideas how to solve this? Andrew.
Mar 18 2005
-Lexet:NT for the linker "Andrew Fedoniouk" <news terrainformatica.com> wrote in message news:d1gfst$4po$1 digitaldaemon.com...In MS C++ I can create console window (e.g. for debugging purposes) by using this: AllocConsole(); freopen("conin$", "r", stdin); freopen("conout$", "w", stdout); // <- here is Win32 Exception exception in D freopen("conout$", "w", stderr); The same trick in D generates Win32 Exception on third line. I did test also freopen("con", "w", stdout); approach with the same negative result. In fact I've solved this problem for myself by just not including .deffilein the project - so it runs as a console app from the very beginning. But I would like to provide an option in runtime - on/off console. Any ideas how to solve this? Andrew.
Mar 19 2005