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.
Is there a hidden window that you didn't close?
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.
in your application object's close event, add:
as the very last line. that should fully force everything to end.
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?
Hi, couple of questions
- Do you have other PB apps that behave "normal" so this particular app is a one off?
- How does app behave if you create brand new target and the app's OPEN event only includes below code?
- Are you sure your app.event CLOSE actually executes?
// 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 - - -
When this happens ..
- Open Task Manager
- Use RHMB on your App
- Select "Go To Details" from pop-up menu
- In resulting Tab Page, use RHMB on your EXE
- Select "Analyze Wait Chain" from resulting pop-up menu
Hopefully, that might give some more information to resolve your closing problem.
Regards ... Chris
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.
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.
- Miguel Leeuwe
- Wednesday, 17 March 2021 01:05 AM UTC
- Chris Pollach @Appeon
- Wednesday, 17 March 2021 01:19 AM UTC
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:
- Insert as first line of app's Open event: RETURN
This should force app to immediately jump to its Close event and then close.
- Then gradually allow more code in app's Open event before "short circuit" RETURN
This should still force app to Close.
- At some point you may need to move the short circuit RETURN to the app manager's pfc_Open and continue.
- As long as you follow this process, each Run! of your app should be very fast.
- 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!
Is there a running background thread from the SharedObject functions?
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:
I hope this article or similar ones provide you with the answer you are looking for.
- Page :
However, you are not allowed to reply to this question.