Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 Mar : Service application

www.cryer.info
Managed Newsgroup Archive

Service application

Subject:Service application
Posted by:"Francois Piette [ICS & Midware]" (francois.piet..@overbyte.be)
Date:Tue, 29 Mar 2005 14:39:37

I'm writing a dual mode service (that is a program that can be run as a
win32 service and as a normal win32 console mode application).

When run as a service, System.IsConsole returns TRUE and yet writing to the
console (Write or WriteLn) results in an I/O error 105. I can easily trap
this error but I want to do better: I want to replace the standard output so
that Write and WriteLn works normally but output goes to a file, a pipe or a
TCP socket.

Any help appreciated (about console I/O driver, not file, pipe or socket).
Any code fragment welcome.

--
francois.piette@overbyte.be
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be

Replies:

www.cryer.info
Managed Newsgroup Archive