dc_fontconfigure in an EXE as service

This forum is for eXpress++ general support.
Post Reply
Message
Author
skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

dc_fontconfigure in an EXE as service

#1 Post by skiman »

Hi,

We have an EXE running as a service. This is working without any problem. Rebooting the server automatically restarts it as a service, without any user action of the need to login on the server.

Now we want to print some document to create PDF files from within this service. It seems as this isn't working, and this gives an error in dc_fontconfigure. I guess this is because there is no presentation space available when running as a service? Anyone who had encountered this problem? Found any solution?

Code: Select all

  IF Valtype(oFont) # 'O'
      oFont := XbpFont():new( oPS )
      oFont:create(cCompoundName)
  ENDIF
I was thinking of saving oPS or oFont previously from the desktop, so the service could load this object. Would this make sense?
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: dc_fontconfigure in an EXE as service

#2 Post by rdonnay »

I have had similar problems with IIS running a CXP program.

Printers do not seem to be recognized under the Administrative account.
The eXpress train is coming - and it has more cars.

User avatar
Tom
Posts: 1234
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: dc_fontconfigure in an EXE as service

#3 Post by Tom »

We're running our services using a local windows account to avoid things like this. If a system account is used, accessing drivers and shares is getting complicated (or is simply not possible). We process export and printing in our services (L&L) and don't have problems with this, although a device context is needed and acquired.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: dc_fontconfigure in an EXE as service

#4 Post by skiman »

Hi Tom,

What do you mean with a 'local windows account'? We just tried to start the service as 'administrator' instead of 'system'. This doesn't resolve our problem.
Best regards,

Chris.
www.aboservice.be

User avatar
Tom
Posts: 1234
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: dc_fontconfigure in an EXE as service

#5 Post by Tom »

Hi, Chris.

A "local windows account" is the account of a concrete windows user (this machine), like "Chris" with the password "iamchris" (Windows login). With this, the service is started using "Chris" as the username and "iamchris" as the password (parameters 4 and 5 of :AddController). When doing this, the context for this user is known by the service, so all devices can be accessed.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: dc_fontconfigure in an EXE as service

#6 Post by rdonnay »

Thanks for that info Tom. That is very valuable.
I could not find that when doing a Google search. :clap:
The eXpress train is coming - and it has more cars.

skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: dc_fontconfigure in an EXE as service

#7 Post by skiman »

Hi Tom,

This morning we tried this, and we don't succeed to print. We checked if our PDF-printer driver was available with this account. Anyway, if we login with the account and start our soapserver, everything is working. If we start our soapserver as a service, it isn't working.

Maybe something you do at the startup of the service?
Best regards,

Chris.
www.aboservice.be

User avatar
Tom
Posts: 1234
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: dc_fontconfigure in an EXE as service

#8 Post by Tom »

In some (most of the?) situations, a leading ".\" must be added to the windows user name when adding it as the 5th parameter to :addController(). So, if your windows user name is "CHRIS", hand ".\CHRIS" to the servicecontroller.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: dc_fontconfigure in an EXE as service

#9 Post by skiman »

Ok, we give it a try.

Tom, I just realise that you are probably installing your services via Xbase++ with the servicecontroller()? Maybe that can be the solution, we will try this also.
Best regards,

Chris.
www.aboservice.be

Post Reply