Skip to Content
author's profile photo Former Member
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 a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Posted on 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 a comment
    10|10000 characters needed characters exceeded

  • Posted on 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 a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on 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 a comment
    10|10000 characters needed characters exceeded

  • Posted on 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 a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on 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 a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 13, 2015 at 03:46 PM

    Hi,

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

    Regards.

    Abdallah.


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.