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.
- You are here:
- Home
- Q&A
- Q&A
- PowerBuilder
- PowerBuilder EXE still runs in background process in Windows 10 1903 after exiting the application
- Chhaya Bisoi
- PowerBuilder
- Thursday, 24 October 2019 16:20 PM UTC
- Thursday, 24 October 2019 17:23 PM UTC
- PowerBuilder
- # 1
Is there a hidden window that you didn't close?
- Thursday, 24 October 2019 17:47 PM UTC
- PowerBuilder
- # 2
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.
- Thursday, 24 October 2019 18:04 PM UTC
- PowerBuilder
- # 3
in your application object's close event, add:
halt
as the very last line. that should fully force everything to end.
- Thursday, 24 October 2019 19:24 PM UTC
- PowerBuilder
- # 4
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?
- Thursday, 24 October 2019 19:42 PM UTC
- PowerBuilder
- # 5
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?
Code (2) - 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 - - -
- Chhaya Bisoi
- Tuesday, 29 October 2019 20:11 PM UTC
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.
-
Helpful Loading... Helpful 0
- Chris Pollach @Appeon
- Thursday, 31 October 2019 17:59 PM UTC
When you migrated to PB2017 ... did you replace the PFC libraries with the latest ones?
FYI: https://github.com/OpenSourcePFCLibraries
HTH
Regards ... Chris
-
Helpful Loading... Helpful 0
- Thursday, 24 October 2019 19:48 PM UTC
- PowerBuilder
- # 6
Hi Chhaya;
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.
HTH
Regards ... Chris
- Tuesday, 29 October 2019 20:07 PM UTC
- PowerBuilder
- # 7
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.
- Thursday, 31 October 2019 07:59 AM UTC
- PowerBuilder
- # 8
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.
- Chris Pollach @Appeon
- Tuesday, 16 March 2021 19:56 PM UTC
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
-
Helpful Loading... Helpful 0
- Miguel Leeuwe
- Wednesday, 17 March 2021 01:05 AM UTC
regards
-
Helpful Loading... Helpful 0
- Chris Pollach @Appeon
- Wednesday, 17 March 2021 01:19 AM UTC
-
Helpful Loading... Helpful 0
- Thursday, 31 October 2019 11:31 AM UTC
- PowerBuilder
- # 9
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!
HTH /Michael
- Thursday, 31 October 2019 12:58 PM UTC
- PowerBuilder
- # 10
Is there a running background thread from the SharedObject functions?
- Thursday, 31 October 2019 13:55 PM UTC
- PowerBuilder
- # 11
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.
Regards,
John
- Olan Knight
- Wednesday, 17 March 2021 19:51 PM UTC
-
Helpful Loading... Helpful 0
- Page :
- 1
However, you are not allowed to reply to this question.