Skip to Content
avatar image
Former Member

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

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

file.JPG (12.5 kB)
Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

6 Answers

  • Aug 13, 2015 at 07:19 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 13, 2015 at 09:59 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 13, 2015 at 12:31 PM

    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?


    Add comment
    10|10000 characters needed characters exceeded

  • Aug 13, 2015 at 01:42 PM

    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!

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 13, 2015 at 03:23 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 13, 2015 at 03:46 PM

    Hi,

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

    Regards.

    Abdallah.


    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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