What's wrong?
Luc
"Peter Fröhlich" <me...@online.de> wrote in message
news:94jmvn$rmd$07$1...@news.t-online.com...
"Luc Kumps" <NOkum...@pandora.be> schrieb im Newsbeitrag
news:L6fb6.257547$MA1.8...@afrodite.telenet-ops.be...
In a service you could create an extra thread, attach it to current desktop
with SetThreadDesktop() (please, do not hardcode window station and desktop.
Use OpenInputDesktop()) and then AllocConsole(). I haven't tried this, but
it could work.
--
JMu
"Peter Fröhlich" <me...@online.de> wrote in message
news:94jmvn$rmd$07$1...@news.t-online.com...
Maybe I didn't explain my purpose detailed enough: primarily I don't want to
supply real debug infos, but some logging
infos for service technicians to verify that the service is running well
without the hazzle of analyzing large logfiles.
Besides that I could ask a customer to read the content of a console window
but I can't request them to read large logs :-)
I already tried the approach with SetThreadDesktop in the interactive
Winsta0 - but it didn't work: AllocConsole() succeeded but the console
window was never displayed on the screen.
"Jarmo Muukka" <jarmo.muukka@helsoftreplacewithdotfi> schrieb im Newsbeitrag
news:e3glc8VhAHA.1324@tkmsftngp05...
A technique I employ in all my services, and it works as well from GUI
programs as well, is the use of a named pipe.
I have a simple named pipe server program I start in a separate window
that listens on a specific (or specified on cmd line) pipe name and
waits for a connection. When it receives one, it simply prints all data
it receives to its console.
From inside the service program, I do fopen ( "\\\\.\\pipe\\pipename",
"w" ) and subsequently use fprintf() to output debug stuff to the other
window. It works very well. You could, of course, #define it in/out
based on whether your build should allow for debug info or not.
Steve