Problem opening the print engine in a Windows service

From: RenDawg (RWerner_at_zolldata.com)
Date: 02/24/05


Date: 24 Feb 2005 07:30:16 -0800

I am having a problem opening the print engine inside of a Windows
Service and was hoping that someone out there might be able to point me
in the right direction as to a possible solution.

Some background information:
I have two apps, one is a service and the other is a configuration
utilty. The configuration utility allows users to configure which
reports the service is going to run, when to run them, which printer to
print to, etc. The configuration utilty also has the ability to
perform a "test run" to make sure everything is working correctly so
users can confirm that the configuration setup is correct.

The code that is executed when the user runs a report from the
configuration utilty and when the service runs the report after
receiving a timer event is exactly the same (and I do mean the same,
they both call a separate dll which goes to the database, gets the
configuration information, opens the print engine and runs the report).

However, for some unknown reason (or at least I have currently been
unable to figure it out), the whole process works fine if you go
through the configuration utilty, but not if you go through the
service.

I've debugged into the service and it is correctly instantiating the
dll and calling the routine to run the report (I know this because I
can debug into the dll routine from both the service and the
configuration utility), but is failing on the PEOpenEngine call. I've
gone and done the subsequent call to PEGetErrorCode to get the error
condition associated with the the open engine call and the error code I
am getting back is 512 or PE_ERR_ENGINENOTOPEN (which I find rather
confusing as well, since that is precisely what I am attempting to do).

Now I have the service logging itself on as a specific user (the same
user that is running the configuration utility), so the only thing I
can think of that is different is the fact that the open engine call is
occuring inside of a Windows Service.

If anyone has any ideas on how to get around this issue, I would be
most grateful.

Thanks,
Renny



Relevant Pages

  • Re: [patch 2.6.28-rc3] regulator: add REGULATOR_MODE_OFF
    ... the Linux configuration will take over automatically if the external ... The Linux regulator configuration being changed outside of the ... plus how any divergence between the Linux and hardware state is ... There's also the issue of how we report a regulator which is turned off ...
    (Linux-Kernel)
  • D-Link Access Point DWL-900AP+ TFTP Vulnerability
    ... ETHEREANET-NCC Security Report EN-NCC-20021014-04 ... D-Link Access Point DWL-900AP+ TFTP Vulnerability ... the device features also an embedded TFTP ... receive a binary image of the device configuration which contains, ...
    (Bugtraq)
  • Re: Random reboots
    ... configured in with the hope that one day they'll report useful ... The sensors might just need some board-specific configuration. ... start if I was suspecting a kernel bug. ... Did you already update the BIOS to the latest version available? ...
    (Linux-Kernel)
  • Re: What exactly are the issues with 2.6.0-test10 preempt?
    ... I've got that Oops while testing my fix of the tmscsim driver for 2.6. ... I just tried a working configuration (with ... reproduce the bug, will report results tomorrow. ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)

Quantcast