1. Tina Prestas
  2. PowerBuilder
  3. Wednesday, 31 January 2018 18:04 PM UTC

Has Powerbuilder addressed the issue that Windows introduced in Server 2016 where in some remote environments there is an issue when mapping default client printers and that information being retained outside of the current session? Here is an article we would outlining the issue https://social.technet.microsoft.com/Forums/windowsserver/en-US/785cbcc6-4f0b-4d88-b12f-2b1d89b85a44/remoteapp-default-printer-redirection-not-working-in-server-2016?forum=winserverTS

Mark Lee @Appeon Accepted Answer Pending Moderation
  1. Friday, 18 January 2019 09:36 AM UTC
  2. PowerBuilder
  3. # 1

Hi Tina,

This issue has been fixed in this latest beta release. Please visithttps://www.appeon.com/developers/pb-2019-beta.html for details about the Beta Program (including the GA release schedule) and download and install the beta version to verify the issue.

 

The fix will also be included in the coming PB 2017 R3 MR release. It is scheduled to be released by the end of this month. You can get the latest status from this link:

https://www.appeon.com/update

 

Regards,

Mark Lee

Comment
  1. Vipin Dwivedi
  2. Tuesday, 2 March 2021 07:57 AM UTC
Hello Mark,

I upgraded to build 1915 but still it does not highlight the default printer all the time. My application is calling PRINT() in-built function but no luck.

Even PrintSetUp() dialog box does not highlight the default printer.

I am not sure if I need to apply Roland's fix to call GetDefaultPrinterW() Windows API.



Vipin.
  1. Helpful
  1. Vipin Dwivedi
  2. Friday, 5 March 2021 22:58 PM UTC
Hello Mark,

Waiting for your comment. Shall I go and apply Roland fix or Appeon is going to do something?



Vipin
  1. Helpful
  1. Mark Lee @Appeon
  2. Monday, 8 March 2021 07:52 AM UTC
Hi Vipin,



Sorry for the late reply.

We suggest that you try Windows API GetDefaultPrinterW() Windows API.

BTW, I also checked your post on the community site, and it seems that is a new bug that we didn’t fix before.

If the issue can’t be worked around, I suggest that you report this problem to our ticket system: https://www.appeon.com/standardsupport/newbug so it can be properly received and tracked.

Please also provide a sample PB test case (with PBT/PBL) when you submit it to the ticket system.



Regards,
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Thursday, 17 January 2019 16:25 PM UTC
  2. PowerBuilder
  3. # 2

We've been having this problem as well.

When you run a remote app, the printer info is copied from your local profile to your profile on the server. This allows the remotely run app to see your local printers and to know which one is default.

The problem is that the profile update and the application are run in parallel. When the PowerBuilder runtime calls GetDefaultPrinter, the operating system hasn't finished copying the profiles so the application has the wrong printer as the default.

To get around this, you need to call GetDefaultPrinter from your PB code and then feed the result into the built in function PrintSetPrinter.

Because the profile update may not be finished, you have to wait as long as possible before doing it. In our app I added it to the end of the main window pfc_postopen event.

 

Comment
  1. Roland Smith
  2. Thursday, 17 January 2019 16:28 PM UTC
Function ULong GetDefaultPrinter ( Ref String pszBuffer, Ref ULong pcchBuffer ) Library "winspool.drv" Alias For "GetDefaultPrinterW"



String ls_null, ls_DefaultPrinter

ULong lul_buffer



// Size the buffer

SetNull(ls_null)

GetDefaultPrinter(ls_null, lul_buffer)

ls_DefaultPrinter = Space(lul_buffer)



// Get the Windows default printer

GetDefaultPrinter(ls_DefaultPrinter, lul_buffer)



// Set the PowerBuilder default printer

PrintSetPrinter(ls_DefaultPrinter)

  1. Helpful
There are no comments made yet.
Mark Lee @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 6 February 2018 08:58 AM UTC
  2. PowerBuilder
  3. # 3

Regarding specifying default printer issue in remote Windows Server 2016, PB 2017 itself doesn’t do any optimization. After all, this issue is caused by Windows environment.

We haven’t used RemoteApp tool, so we are not sure whether the issue also exists in PB 2017.

We will also study and verify the issue with using this tool.

Regards,

Mark Lee

Comment
  1. Vipin Dwivedi
  2. Friday, 5 March 2021 23:03 PM UTC
Hello Mark,

Did you get any fix? I tried in PB-2017R3 MR 1858,1880, 1915 but all are highlighting the server printer and not client redirect printer. PrintGetPrinter() in-build PB function gives different result(server default printer) while GetDefaultPrinter() gives client redirect printer (but not all the time).



Any luck?



Regards.... Vipin
  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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.