digitalmars.D - Console Output
- Trevor Parscal (7/7) May 31 2005 Does anyone know of a way to output to a console even if a WinMain
- Andrew Fedoniouk (5/12) May 31 2005 Do not include .def file while linking and you'll be able to use
- Derek Parnell (9/11) May 31 2005 It sort of is...
- Andrew Fedoniouk (4/11) May 31 2005 Sacred knowledge:
- Andrew Fedoniouk (22/22) May 31 2005 And one more solution:
- David L. Davis (12/19) May 31 2005 Trevor,
Does anyone know of a way to output to a console even if a WinMain function is present. It seems like this should be simple.. -- Thanks, Trevor Parscal www.trevorparscal.com trevorparscal hotmail.com
May 31 2005
Do not include .def file while linking and you'll be able to use printf in console. Andrew. "Trevor Parscal" <trevorparscal hotmail.com> wrote in message news:d7ioc7$2p9l$1 digitaldaemon.com...Does anyone know of a way to output to a console even if a WinMain function is present. It seems like this should be simple.. -- Thanks, Trevor Parscal www.trevorparscal.com trevorparscal hotmail.com
May 31 2005
On Tue, 31 May 2005 15:27:16 -0700, Trevor Parscal wrote:Does anyone know of a way to output to a console even if a WinMain function is present. It seems like this should be simple..It sort of is... look up the Windows SDK for AllocConsole, GetStdHandle, WriteConsole, ReadConsoleInput, and FreeConsole. There a re a few other functions available to, but these are the basic ones. -- Derek Melbourne, Australia 1/06/2005 9:37:12 AM
May 31 2005
"Derek Parnell" <derek psych.ward> wrote in message news:1pmj54hl4v7jy$.j6m1vccfnsy2$.dlg 40tude.net...On Tue, 31 May 2005 15:27:16 -0700, Trevor Parscal wrote:Sacred knowledge: http://www.digitalmars.com/d/archives/digitalmars/D/learn/52.htmlDoes anyone know of a way to output to a console even if a WinMain function is present. It seems like this should be simple..It sort of is... look up the Windows SDK for AllocConsole, GetStdHandle, WriteConsole, ReadConsoleInput, and FreeConsole. There a re a few other functions available to, but these are the basic ones.
May 31 2005
And one more solution: dwritef - writef into debugging console (VisualStudio or WinDbg) version(Windows) { extern (Windows) { export void OutputDebugStringA(char* lpOutputString); } } debug void dwritef(...) { char[] s; void putc(dchar c) { std.utf.encode(s, c); } std.format.doFormat(&putc, _arguments, _argptr); version(Windows) { OutputDebugStringA(s); } } else void dwritef(...) {}
May 31 2005
In article <d7ioc7$2p9l$1 digitaldaemon.com>, Trevor Parscal says...Does anyone know of a way to output to a console even if a WinMain function is present. It seems like this should be simple.. -- Thanks, Trevor Parscal www.trevorparscal.com trevorparscal hotmail.comTrevor, You may find the D converted version of wincon.h, renamed to wincon.d on my site useful...there's also two very useful examples included in the download. Just look for the "Fun with the NT / XP Console in D", which is the bottom entry of the following web page. http://spottedtiger.tripod.com/D_Language/D_Hub_Adv_Tutor_XP.html David L. ------------------------------------------------------------------- "Dare to reach for the Stars...Dare to Dream, Build, and Achieve!" ------------------------------------------------------------------- MKoD: http://spottedtiger.tripod.com/D_Language/D_Main_XP.html
May 31 2005