Discussion:
Passing a COM object pointer to a COM property?
(too old to reply)
Flemming
2007-11-24 23:00:33 UTC
Permalink
Hello David,

I attempted to write a COM application about 1œ years ago but ran into some limitations. I ended up writing most of the COM interfacing in VB. Seeing that one of the limitations (output parameters) among other has been lifted and needing to extend the application, I figured I'd try again with APL2.
I need to pass a COM object pointer as a parameter to a property, and I can't make it work.

Here is what I get with the QUERY command:

SendOrder PROPERTY() I4 SendOrder(ITTOrderProfile* pOrderProfile[in])

Reading the UG page 202, I figured the following would work:

COM 'PROPERTY' OBJECT3 'SendOrder[]' ('*' OBJECT1)

but it doesn't - it gives COM error code 80020006.

Am I doing something wrong, or is it just not supposed to work with COM objects in the parameter list?

Best regards,


Flemming Schultze
Nancy Wheeler
2007-11-26 02:36:12 UTC
Permalink
Flemming,

Just to let you know, David is on vacation and will be back on 29 Nov.

Nancy Wheeler
APL Products and Services
Post by Flemming
Hello David,
I attempted to write a COM application about 1½ years ago but ran into
some limitations. I ended up writing most of the COM interfacing in
VB. Seeing that one of the limitations (output parameters) among
other has been lifted and needing to extend the application, I figured
I'd try again with APL2.
I need to pass a COM object pointer as a parameter to a property, and I can't make it work.
SendOrder PROPERTY() I4 SendOrder(ITTOrderProfile*
pOrderProfile[in])
COM 'PROPERTY' OBJECT3 'SendOrder[]' ('*' OBJECT1)
but it doesn't - it gives COM error code 80020006.
Am I doing something wrong, or is it just not supposed to work with COM
objects in the parameter list?
Best regards,
Flemming Schultze
Mike
2007-11-29 17:36:55 UTC
Permalink
Flemming,

CREATE command returns a pointer.
I've never tried but I think this should work:
COM 'PROPERTY' OBJECT3 'SendOrder' OBJECT1

Mike.
David Liebtag
2007-12-03 15:24:45 UTC
Permalink
Flemming,

The prototype indicates SendOrder's argument is a pointer to an
ITTOrderProfile interface. You can get this pointer either by calling
CREATE or by calling a method or property that returns the pointer as either
a result or an updated argument. Once you have the pointer, you should be
able to reference the property like this:

COM 'PROPERTY' Object 'SendOrder()' OrderProfile

Where:

Order is the object that supports the SendOrder property
OrderProfile is the pointer to the ITTOrderProfile interface

David Liebtag
IBM APL Products and Services

PS Sorry for the late response. I have been on vacation and then sick.
Loading...