on 08-13-2015 7:03 AM
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
Hi,
Which PowerBuilder version/build are you using and on which OS ?
Regards.
Abdallah.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.