We are using PowerBuilder 2022 R2 and have written the following code:
Long ll_result
iole_cad = CREATE OleObject
ll_result = iole_cad.ConnectToNewObject("prjInsert.clsInsert")
// prjInsert is a VB project and clsInsert is a VB class.
If ll_result <> 0 then
MessageBox("Error connecting to OLE object")
Else
// some different code
End If
ll_result = iole_cad.DisconnectObject()
Destroy iole_cad
When I run the application for the first time, the variable ll_result has a value of 0 (indicating success). However, when I run it a second time, ll_result has a value of -3, causing the application to fail.
Why am I getting -3 from the second run onwards, and what can be the solution for this?
In 22.1.0.2819, that would be when PB moved up to using the VC++ 2019 compiler internally from version 2010. In PB 2022 R3, Appeon moved up to using VC++ 2022 compiler. So there might have been an anomaly caused there. If you can, try PB 2022 R3 (latest MR) & see if that rectifys your OLE issue. In the meantime, just keep on build 21.0.0.1506.
Regards ... Chris
My entire application has already been migrated to PB Runtime 22.1.0.2819, so I can't revert to version 21.0.0.1506. I need to continue using 22.1.0.2819. Is there any possible fix or workaround that would allow my application to function properly across multiple instances with this version (22.1.0.2819) of PB?
Thanks,
Gayathri
In that case, you can try opening a Support Ticket for this build issue & see if Appeon Engineering can help.
https://www.appeon.com/developers/get-help
Regards ... Chris