I'm working my way through the PBNI Programmers Guide, as our company could benefit from some of the PBNI's functionality for testing purposes - notably the PBNI's capability to create and manipulate objects dynamically.
I was particularly interested in the possibility of loading the pbvm170.dll into a c++ application and then start a PB-GUI-Application from there. Thus the first thing I did was to carefully replicate the one example given in the programmers guide under "Calling Powerbuilder from c++", which includes loading the pbvm170.dll with loadlibrary, getting a pointer to the IPB_VM-Interface, creating a session, and importantly, having a message loop running where the session's function processPBMessage is called.
The example worked out fine on first sight, with the application's windows appearing on the screen, able to take user input. But a runtime error (Null object reference) occured every time a newly opened window (opened via openwithparm with some Powerobject parameter) tried to read a property from the PowerObjectParm of the Message Object . The message.PowerObjectParm was an invalid object in that case.
Does someone know why that is and how I could fix it? I have attached a zip file containing 1) a simple PB-Project whose target Application does nothing but open a window with a parameter via openwithparm, where this window then tries to read a property of the message.PowerObjectParm and 2) a c++ File that follows the required steps to start the Application. With this setup, I get the mentioned runtime error.
I use Powerbuilder Version 2017 R3 Build 1880.
Thanks for any advice!