1. Kevin Dinh
  2. PowerBuilder
  3. Tuesday, 21 December 2021 20:20 PM UTC

Hello All,

I notice once our application (created in Powerbuilder) is opened; the winspool automatically preloaded the printer drivers. 

Is there a way to not preload the printer drivers when the application is opened?  Can it load the printer drivers at the later time?

The issue we encounter:

Sometimes, we are unable to open the application (running in Horizon environment).  Once we stopped and restarted the winspool service then the application can be opened.  What might be the problem?

 

Example: When I opened Notepad.exe or WinWord.exe; the winspool doesn't get called until I select the Print option.

 

Any suggestions would be very appreciated.

Thanks,

Kevin

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 21 December 2021 21:35 PM UTC
  2. PowerBuilder
  3. # 1

Hi Kevin;

   Does your PB App make direct calls to the WinSpool DLL as an external API?

ie:  FUNCTION   ulong  AddPrinterDriver(ref string pName,ulong Level,ref Byte pDriverInfor) LIBRARY "WINSPOOL.drv" ALIAS FOR "AddPrinterDriverW"

Regards ... Chris

Comment
  1. Kevin Dinh
  2. Tuesday, 28 December 2021 19:23 PM UTC
Hi Chris,

I declared this API call in the Global External Functions.

FUNCTION ULong GetDefaultPrinterW(REF String pszBuffer, REF ULong pcchBuffer) LIBRARY "winspool.drv" ALIAS FOR "GetDefaultPrinterW"



I have code to call GetDefaultPrinterW before any printing process.



Question:

How many time or often the "winspool.drv" get fetched? Once or every time the printing process get called?



Thanks,

Kevin



  1. Helpful
  1. Kevin Dinh
  2. Tuesday, 28 December 2021 19:28 PM UTC
...also what version of Powerbuilder that fixed the Default Printer that is no longer need to define the GetDefaultPrinterW()
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Wednesday, 22 December 2021 17:44 PM UTC
  2. PowerBuilder
  3. # 2

DataWindows use the current printer settings when doing layout, checking the margin widths for example. That may be why it starts.

Comment
  1. Roland Smith
  2. Thursday, 23 December 2021 18:23 PM UTC
If all the pb.ini runtime settings were in the help, that would be a big help.
  1. Helpful
  1. Kevin Dinh
  2. Thursday, 23 December 2021 19:49 PM UTC
First - Merry Christmas to all.

Second - we do not distribute pb.ini to our Customers. We are switching to host our PB App from Citrix to VMWare Horizon. We use ProcMon.exe to monitor the process when launching our PB App and notice that it's searching for winspool to gather all the printers.
  1. Helpful
  1. Brad Mettee
  2. Wednesday, 29 December 2021 16:13 PM UTC
The PB.ini file can be created on the host machine with only that one entry in it. You don't need to distribute your copy to them. Just put the following into PB.INI in the same directory as your executable.



[Data Window]

Citrix=1

  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.