Hi, I am using PowerBuilder 2019 R3 build 2703.
Created service for ‘srvany.exe’ on Windows Server 2016.
Program (let’s call it BAR) starts when runs as a service. Window ‘password’ opens from the application object Open event ‘Open(w_pass)’
User id and password sets from INI file in the ‘w_pass’ open event, then calling cb_ok.PostEvent(clicked!)
Database connection established in the cb_ok clicked event then calling Open(w_main)
Window ‘w_main’ not opens if program runs as a service, but if I run that same program on desktop it is working without a problem.
There is another PowerBuilder program (very similar to the BAR, let’s call it ADT) runs on the same machine.
The ADT program is running as service without any problem. Both programs have similar codes how to sign-in and open main window but BAR not working.
Is anyone come across similar issue? Does anyone know what and where I need to check to find the problem?
Thank you, an advance, for your time and help.
The Windows OS manages GUI threads much differently than it does non-GUI threads, as there are more types of resources that need to be tracked and managed. The additional complexity of setting up a DefWindowProc (default Windows message handling procedure) to handle user interaction may also be a factor. This is why an application that runs as a service should ONLY be coded with non-visual objects (NVO's, as Chris clearly stated in his initial and second response to this issue. As soon as you include a visual object in a PB app, it becomes a GUI application and it will execute in a GUI execution thread.
I learn something new every day! :)