1. Gayathri Bollikonda
  2. PowerBuilder
  3. 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?

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 6 August 2024 13:42 PM UTC
  2. PowerBuilder
  3. # 1

Hi Gayathri;

  Suggestion: if you wrap the OLE logic in a TRY...CATCH, the "Exception" created on the 2nd call failure could give you a lot more information as the actual problem.

  Also, check the O/S logs as well for issues from the OLE Server app itself.  HTH 

Regards ... Chris 

Comment
  1. Chris Pollach @Appeon
  2. Friday, 9 August 2024 12:56 PM UTC
Hi ???

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
  1. Helpful
  1. Gayathri Bollikonda
  2. Sunday, 11 August 2024 17:24 PM UTC
Hi 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
  1. Helpful
  1. Chris Pollach @Appeon
  2. Sunday, 11 August 2024 17:54 PM UTC
Hi 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
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.