- Gayathri Bollikonda
- PowerBuilder
- Tuesday, 6 August 2024 06:01 AM UTC
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?
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.