1. Troy Cowan
  2. PowerBuilder
  3. Friday, 22 April 2022 17:49 PM UTC

I'm seeing different behavior between two versions of our application. It just so happens that we changed versions of PowerBuilder from the first version to the second, so the behavior difference could be caused by a code change of ours, or some change in PowerBuilder.

The PowerBuilder versions in question are 2017 and 2017R3.

The behavior change is this: If the default printer is changed at the OS level while our application is open, the application immediately sees that change in our earlier version built with PB 2017, but does not in our version built with PB 2017R3. With that version, you have to actually restart the application for it to register the change in default printer. 

I'm told by my co-developers that we haven't made any changes that would be related to how our application deals with printers. Is there a known issue here that would explain this? Or could someone run a test to see? 

Thanks in advance.

Ken Guo @Appeon Accepted Answer Pending Moderation
  1. Sunday, 24 April 2022 05:48 AM UTC
  2. PowerBuilder
  3. # 1

Hi Troy,

Even if you change the Default Printer in Windows OS, it should not affect the current Printer in PB applications, which has always been the logic in PB.

If you want to change the current printer of PB, you need to use the PrintSetPrinter function to do so. For details, please see PB Help:

The current printer is the default printer unless you change it with the PrintSetPrinter method. A PowerBuilder application calling the PrintGetPrinter method does not get an externally reset default after the application initializes.
https://docs.appeon.com/pb2021/powerscript_reference/printGetPrinter_func.html 

If you encounter behavior inconsistent with the above logic in PB 2017, it is due to a regression caused by other bug fixes that we have since corrected to be consistent with previous Sybase PB releases and the description in Help.

Regards,
Ken

Comment
  1. Troy Cowan
  2. Monday, 25 April 2022 11:20 AM UTC
Well, not sure what to say about that. To me, it's fairly obvious that the previous behavior is the preferred behavior. It sounds like you are saying it was wrong then, and correct now. I opened a bug against this: 8282. I will be interested in hearing what is decided about it.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 22 April 2022 18:20 PM UTC
  2. PowerBuilder
  3. # 2

Hi Troy;

  Are you using PB2017R3 build 1951?

Regards ... Chris

Comment
  1. Chris Pollach @Appeon
  2. Friday, 22 April 2022 19:18 PM UTC
Hi Troy;

I have now confirmed your default printer behaviour as well on my W10 build 19044.1645, as follows:.

=> For Apps run from the PB IDE (i am using PB2021 build 1506), the default printer never changes (even if you change it in the O/S control Panel).

=> For Apps run from their EXE's, the default printer ONLY changes when you restart the EXE

I would suggest opening a Support Ticket for this issue.

Regards ... Chris
  1. Helpful 1
  1. Troy Cowan
  2. Saturday, 23 April 2022 22:25 PM UTC
How do I do that? Is that just an email to communitysupport@appeon.com ?
  1. Helpful
  1. Chris Pollach @Appeon
  2. Sunday, 24 April 2022 00:35 AM UTC
  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.