1. Chhaya Bisoi
  2. PowerBuilder
  3. Thursday, 24 October 2019 16:20 PM UTC

Hi, My existing application was in PowerBuilder 12.5 and migrated the application to PowerBuilder 2019 and running in Windows 10 version 1903 desktop. When I run the application exe, the application runs fine. But when I exit from application or X it out, the application closes. But the exe is still runs in the background process which I can see in the task manager. Anyone faced this issue or what is the root cause of this issue. Any insight is greatly appreciated.

John Fauss Accepted Answer Pending Moderation
  1. Thursday, 31 October 2019 13:55 PM UTC
  2. PowerBuilder
  3. # 1

According to Microsoft documentation, SplWOW64.exe provides "thunking" services (access to the 64-bit Windows Print Spooling sub-system) for 32-bit applications. It is a core component of Windows. A web search for "splwow64.exe windows 10 hangs applications" produced several hits. The following link is just one that was returned:

https://answers.microsoft.com/en-us/windows/forum/windows_10-other_settings/splwow64exe-does-not-end-after-a-print-job-in/e09966f6-07ba-4eef-907a-daf5aebb65f2

I hope this article or similar ones provide you with the answer you are looking for.

Regards,
John

Comment
  1. Olan Knight
  2. Wednesday, 17 March 2021 19:51 PM UTC
I did not know that. Thanks for the post, John!
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Thursday, 31 October 2019 12:58 PM UTC
  2. PowerBuilder
  3. # 2

Is there a running background thread from the SharedObject functions?

 

Comment
There are no comments made yet.
Michael Kramer Accepted Answer Pending Moderation
  1. Thursday, 31 October 2019 11:31 AM UTC
  2. PowerBuilder
  3. # 3

WHat you see is definitely odd. App should close when last window is closed.

Your app not reaching app's Close event tells me it either has open windows handles (displayed or hidden windows) - or the process thread hangs, potentially deadlocked.

Your finding re the printer spooler indicates likewise. Somehow, somewhere in your code their is likely functionality calling the printing feature, perhaps code starting some printjob but not closing the printjob.

Alternative I sometimes see weird behavior if an app has duplicate events mapped to same EventID.

EX 1: User event mapped to pbm_close of a window may have the user event fire but not that window's regular Close event.

EX 2: User event mapped to a printing event ID and triggered by code using the event name - which may (inside the PB VM) initiate some printing functionality.

I can't tell exactly where code hits the print feature. For debug purposes I would:

  1. Insert as first line of app's Open event: RETURN
    This should force app to immediately jump to its Close event and then close.
  2. Then gradually allow more code in app's Open event before "short circuit" RETURN
    This should still force app to Close.
  3. At some point you may need to move the short circuit RETURN to the app manager's pfc_Open and continue.
  4. As long as you follow this process, each Run! of your app should be very fast.
  5. At some point you should see that adding one extra line suddenly starts blocking your app from closing
    - and - there's your culprit statement I expect!

HTH /Michael

 

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 31 October 2019 07:59 AM UTC
  2. PowerBuilder
  3. # 4

Do you have any code or commented code in the SystemError of your application?

Try putting a HALT CLOSE in the systemerror event.

Just to check if something causes a systemerror when exiting your application and might not be showing somehow.

 
Comment
  1. Chris Pollach @Appeon
  2. Tuesday, 16 March 2021 19:56 PM UTC
Hi Miguel;

NEVER use a "Halt Close" in the System Error event. That could easily cause an infinite loop or random crashes! Only use a HALT command in the System Error event. ;-)

Regards ... Chris
  1. Helpful
  1. Miguel Leeuwe
  2. Wednesday, 17 March 2021 01:05 AM UTC
yes, I think you are right, I re-read this comment I made today and already I was wondering myself why I would recommend that. The idea was to see if anything would trigger a system error, but a messagebox() would have been enough for that.

regards
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 17 March 2021 01:19 AM UTC
That's another pitfall ... A message box during any error handling. In my Framework's, if the App is running in non-visual mode (Framework setting) - which means as a batch, console or O/S service - then any error is only logged & a Halt command is then only given. Nothing visual is attempted.
  1. Helpful
There are no comments made yet.
Chhaya Bisoi Accepted Answer Pending Moderation
  1. Tuesday, 29 October 2019 20:07 PM UTC
  2. PowerBuilder
  3. # 5

I tried analyze wait chain. What I am getting is that application.exe is waiting for another process which is SplWOW64.exe .

Even I tried to disable this Splwow64.exe from print services, it does not help.

One thing noticed, sometimes it works and sometimes it does not in the current version of Win 10 1903.

But the same application is working in Win 7 and earlier version of Win 10 for several years and this process never been a background process after closing the application.

I have another small PB application which works perfectly and the exe goes out of processes after closing the application. I created a small PB application exe and this also works fine.

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 24 October 2019 19:48 PM UTC
  2. PowerBuilder
  3. # 6

Hi Chhaya;

   When this happens ..

  1. Open Task Manager
  2. Use RHMB on your App
  3. Select "Go To Details" from pop-up menu
  4. In resulting Tab Page, use RHMB on your EXE
  5. Select "Analyze Wait Chain" from resulting pop-up menu

Hopefully, that might give some more information to resolve your closing problem.

HTH

Regards ... Chris

Comment
There are no comments made yet.
Michael Kramer Accepted Answer Pending Moderation
  1. Thursday, 24 October 2019 19:42 PM UTC
  2. PowerBuilder
  3. # 7

Hi, couple of questions

  1. Do you have other PB apps that behave "normal" so this particular app is a one off?
  2. How does app behave if you create brand new target and the app's OPEN event only includes below code?
    Code (2)
  3. Are you sure your app.event CLOSE actually executes?
    Code (3)
// Code (2)
// App.event Open
MessageBox( "Hello", "World!")
// - - - END - - -

// App.event Close
MessageBox( "Good", "Bye")
// - - - END - - -


// Code (3)
MessageBox("App.Close", "Start")
. . . (rest of app.Close event) . . .
// - - - END - - -
Comment
  1. Chhaya Bisoi
  2. Tuesday, 29 October 2019 20:11 PM UTC
I verified this.

Application OPEN event is fired but not the CLOSE event in this application. Instead of CLOSE, application pfc_exit() is fired. Forcing the destroy of the application also does not help.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 31 October 2019 17:59 PM UTC
Hi Chhaya ;

When you migrated to PB2017 ... did you replace the PFC libraries with the latest ones?

FYI: https://github.com/OpenSourcePFCLibraries

HTH

Regards ... Chris
  1. Helpful
There are no comments made yet.
Chhaya Bisoi Accepted Answer Pending Moderation
  1. Thursday, 24 October 2019 19:24 PM UTC
  2. PowerBuilder
  3. # 8

Added HALT in last line in close event of the application and rebuild the project and deployed. No Luck.

 

Is it related to PowerBuilder IDE? As when I run the application from IDE and exit from there, it is not coming back to the script page. In stead it is prompting me to Terminate or Cancel the application. Upon termination, it takes me back to the script page. Are these two issues linked in any way?

Comment
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Thursday, 24 October 2019 18:04 PM UTC
  2. PowerBuilder
  3. # 9

in your application object's close event, add:

halt 

 

as the very last line.   that should fully force everything to end.

Comment
There are no comments made yet.
Chhaya Bisoi Accepted Answer Pending Moderation
  1. Thursday, 24 October 2019 17:47 PM UTC
  2. PowerBuilder
  3. # 10

I don't think so. Even without opening any other window, just the frame and exit it out. I am seeing this issue in latest version of Win 10. It used to work in Win 7 and earliest version of Win 10 but not with recent two version of Windows 10.

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Thursday, 24 October 2019 17:23 PM UTC
  2. PowerBuilder
  3. # 11

Is there a hidden window that you didn't close?

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.