1. Marie Bisschoff
  2. PowerBuilder
  3. Tuesday, 23 March 2021 11:01 AM UTC

hi,

We set our printer to a laser printer but when we go into our Label screen we change our Default Printer to the Zebra Label printer.

We then just print.(too the default)

Once we out of the screen we set the default printer back  to the laser printer.

In powerbuilder 2019 R3 it still prints to the laser printer, but in Powerbuilder 2017 not.

Do  you cash your printers in Powerbuilder 2019 r3.

What can I do?

Regards

MLB

Marie Bisschoff Accepted Answer Pending Moderation
  1. Tuesday, 23 March 2021 20:13 PM UTC
  2. PowerBuilder
  3. # 1

Hi,

Sorry, I inherited the code.

WriteProfileStringA ("windows", "device", gs_printer)

 

Global External Function

function long WriteProfileStringA (string as_section, string as_key, ref string as_value) library "KERNEL32" alias for "WriteProfileStringA;Ansi"

 

Regards

MLB

Comment
  1. Marie Bisschoff
  2. Wednesday, 31 March 2021 08:40 AM UTC
HI,



So I check in Windows 10. It set the default printer correctly to the Zebra printer.

But in Powerbuilder 2019 R3 with printjob it then doesn't print to the zebra printer.



Regards

MLB



  1. Helpful
  1. Marie Bisschoff
  2. Wednesday, 31 March 2021 08:42 AM UTC
The Zebra printer connects on the other computers through LPT (Zebra Label Printer winspool LPT1:) but this one through NE (Zebra Label Printer winspool Ne00:)
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 31 March 2021 15:50 PM UTC
Hmmm ... sounds like an environment / set-up issue to me (as my best guess).

How ever, it might be worth opening a Support Ticket if you can work OK from an R2 App vs R3.
  1. Helpful
There are no comments made yet.
Marie Bisschoff Accepted Answer Pending Moderation
  1. Tuesday, 23 March 2021 19:35 PM UTC
  2. PowerBuilder
  3. # 2

Hi,

String ls_default_printer

ls_default_printer = Space(255)

GetProfileStringA("windows", "device", ",,,", ls_default_printer, Len(ls_default_printer))

 

Global External Function

function long GetProfileStringA (string as_section, string as_key, string as_default, ref string as_value, long al_size) library "KERNEL32" alias for "GetProfileStringA;Ansi"

Regards

MLB

Comment
  1. Chris Pollach @Appeon
  2. Tuesday, 23 March 2021 19:50 PM UTC
Wow .. that is really weird code as the GetProfileString() is a PB built-in command (since PB v1.0) vs using the MS-Windows API that your App seems to be using. The API your App is using is outdated as its an old ANSI SDK command (GetProfileStringA). Since PB v10.0 and higher,, PB is Unicode based. Just an FYI.

This still does not explain how your App is setting the default printer?
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 23 March 2021 18:42 PM UTC
  2. PowerBuilder
  3. # 3

Hi Marie;

  What mechanism is your PB App(s) using to swap default printers?

Regards ... Chris

Comment
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.