colttaylor
Programmer
I've written a NT Service in Delphi 5 which receives directory change notification messages for an empty directory. Whenever a file gets created in that directory, my service reads it into a stringlist, formats it and then tries to print it.
Everything is working up to the "print it" part.
When the service calls printer.begindoc, it stops executing (I try to make a log entry right after the call to begindoc and that log entry never gets written out). The service still appears to be running, but my code stops right there.
Prior to calling the begindoc, I set the printer.printerindex so it is not that the software doesn't know where to print.
When I stop the service, that seems to break the program's trance. The log entries show that all of the printer.canvas.textout calls occur and that a printer.enddoc call finishs off the process. Nothing prints but no exceptions or logical errors occur.
Has anybody got any experience using printer.begindoc from a service? If not, has anybody ever successfully printed from a service in any language or by any other technique?
Any help would be appreciated!
Thanks!
Peace,
Colt
If it's stupid but it works, it isn't stupid
Everything is working up to the "print it" part.
When the service calls printer.begindoc, it stops executing (I try to make a log entry right after the call to begindoc and that log entry never gets written out). The service still appears to be running, but my code stops right there.
Prior to calling the begindoc, I set the printer.printerindex so it is not that the software doesn't know where to print.
When I stop the service, that seems to break the program's trance. The log entries show that all of the printer.canvas.textout calls occur and that a printer.enddoc call finishs off the process. Nothing prints but no exceptions or logical errors occur.
Has anybody got any experience using printer.begindoc from a service? If not, has anybody ever successfully printed from a service in any language or by any other technique?
Any help would be appreciated!
Thanks!
Peace,
Colt
If it's stupid but it works, it isn't stupid