cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Error "Error accessing external object function(R0035)"

Former Member
0 Kudos

Hi,

I am trying access OCX file using oleobject in powerbuilder.When calling functions of ole throws below error.

sample code:

oleobject ole_card

ole_card= create oleobject

ll_ret = ole_card.ConnectTonewobject("EIDA_ZP_ACTIVEX.UAEIDCardActiveXCtrl.1")

  IF ll_ret = 0 THEN

      ls_ret = ole_card.Initialize() //fails when it calls this function

  END IF

Note : I have registered OCX file.

Any help would be appreciated!

Thanks,

Anil

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi,

Which PowerBuilder version/build are you using and on which OS ?

Regards.

Abdallah.


Former Member
0 Kudos

Dear Abdallah,

I am working Powerbuilder 10.5 Build 4523 and using windows XP and Windows 7 professional.

I found one more thing that OCX is working fine for ASP.net / Java base web application.

Regards,

Anil

Former Member
0 Kudos

I would create a standard class user object of type oleobject and then try accessing the ocx.  I've had better luck in the past using this method to access all the properties and getting the error messages.

0 Kudos

Hi Terry,

Can you show an example how to define the standard class that access the ocx ?

Thanks.

Former Member
0 Kudos

Can you use the card reader from someone native software? (Be sure the problem is not with a driver or somewhat else.)

Can you use the OCX from another application (e.g. write a word macro to test it)?

Also remember: 32bit PB application can only access a 32bit OCX control!

Former Member
0 Kudos

First thing to check would be the function definitions in the browser on the ole tab.

So what are the details of the function list of the object ("EIDA_ZP_ACTIVEX.UAEIDCardActiveXCtrl.1") ?

Is there a function initialize and what arguments does it have?


arnd_schmidt
Active Contributor
0 Kudos

Hi Anil,

you should try to catch all of the OLE related runtime errors.

long ll_ret

string ls_ret

oleobject ole_card

ole_card = create oleobject

TRY

  ll_ret = ole_card.ConnectToNewobject("EIDA_ZP_ACTIVEX.UAEIDCardActiveXCtrl.1")

  IF ll_ret = 0 THEN

    ls_ret = ole_card.Initialize() //fails when it calls this function

  END IF

CATCH (OLERuntimeError err)

  MessageBox("Error:  " + string(err.Number), err.GetMessage() +'~r~n' + err.Description)

END TRY

hth

Arnd

Former Member
0 Kudos

Hi Arnd,

I am not getting any error description.

arnd_schmidt
Active Contributor
0 Kudos

Is this is visual control?

Former Member
0 Kudos

No it was a non visual control for connecting to card reader and return card information.

arnd_schmidt
Active Contributor
0 Kudos

So, if the object is registered you can browse its properties and functions via PowerBuilders OLE Browser (or VBA's OLE Browser in Word Excel etc).

Open the PowerBuilder OLE Browser via Menu -> Tools -> Browser => tabpage "OLE".

Arnd

Former Member
0 Kudos

I am able to see all the functions of OLE but when trying to call any function in the list getting error.

Former Member
0 Kudos

There is something wrong with the call to the initialize function (e.g. missing parameters) or the function cancels with an exception.

Try to catch the OLERuntimeError exception. There is a property "Description" in that exception object that may have more information for you.

TRY

    ls_ret = ole_card.Initialize()

CATCH (OLERuntimeError e)

     MessageBox ("Error", e.Description)

END TRY

Former Member
0 Kudos

Hi Rene

Thanks for your reply...I tried to capture error description but there is no description captured.