1. Sathishkumar S
  2. PowerBuilder
  3. Tuesday, 28 March 2023 18:07 PM UTC

Hi All,


I would like to know if there is any way to perform printing asynchronously. I am facing an issue where the application crashes on pbdwe.dll when the user clicks print and closes the window before the printing process completes, which is happening in the background.

I am considering separating the printing process from the window to make it independent (asynchronously).

 

Our application, built on PB 2022 Build 1892, crashes when the user prints (using 'print immediate') and closes the window.

We have analyzed the issue and tried some solutions,

1. Including disabling the close button and control menu (which worked but doesn't seem like the best solution),
2. Creating a popup window to display during the printing process (which we close once the printing is completed),
3. and using an instance Boolean variable to track whether printing is happening or not, and allowing the screen to close if the user chooses to do so.

However, all of these attempts still result in a crash if the application is closed during the printing process.

Looking for any ideas, suggestions, or guidance from anyone who has faced the same issue.

Thank you
Sathishkumar.

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 28 March 2023 21:31 PM UTC
  2. PowerBuilder
  3. # 1

Hi Sathishkumar;

  FWIW: To be extra safe - I would just disable the main App window and show a mouse processing pointer until that process is completed.

During the printing cycle though, you could still post progress information to the MicroHelp bar. Food for thought  ;-)

Regards ... Chris

Comment
  1. Sathishkumar S
  2. Wednesday, 29 March 2023 03:36 AM UTC
Hi Chris,



Thank you I will try as you suggested.



Thanks & Regards

Sathishkumar
  1. Helpful
  1. Markus Eckert
  2. Wednesday, 29 March 2023 13:52 PM UTC
Hi Chris

That seems like a good approach to prevent these kinds of issues.

However when I set the main window to enabled=false at runtime, while the time the print cancel dialog is shown, the last active application (be that Outlook, Word, Explorer, another instance of our application) is shown on top of the active application. If I print multiple documents, display switches back and forth between the active application and previous window.

Do you know of a way to prevent this from happening (short of disabling the print cancel dialog)
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 29 March 2023 17:56 PM UTC
Hi Markus;

You can try the TopMost! option in the <Window.>.SetPosition ( ) command.

Note: Don;t forget to reset the position though after the long process is completed. ;-)

Regards ... Chris
  1. Helpful 1
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.