Obtains a COM interface pointer for a particular interface from a COM object.
com
query-object-interface class-name object iid &key ppv-object => hresult, interface-ptr-for-iid
class-name⇩ |
A COM class name. |
object⇩ |
A COM object to be queried. |
iid⇩ |
The iid of a COM interface. |
ppv-object⇩ |
A foreign pointer or nil . |
hresult |
The hresult. |
interface-ptr-for-iid⇩ | |
The new interface pointer or nil if none. |
The macro query-object-interface
invokes the COM method IUnknown::QueryInterface
to attempt to obtain an interface pointer for iid from object.
iid can be a symbol naming a COM interface or a refguid foreign pointer containing its iid.
class-name must be the COM object class name of object or one of its superclass names.
The first value is the integer hresult from the call to IUnknown::QueryInterface.
If the result indicates success, then interface-ptr-for-iid is returned as the second value. If ppv-object is non-nil, then interface-ptr-for-iid will be stored there as well.
(query-object-interface foo-impl p-foo 'i-bar)
COM/Automation User Guide and Reference Manual - 01 Dec 2021 19:38:38