All Manuals > COM/Automation User Guide and Reference Manual > 2 COM Reference Entries

query-object-interface Macro

Summary

Obtains a COM interface pointer for a particular interface from a COM object.

Package

com

Signature

query-object-interface class-name object iid &key ppv-object => hresult, interface-ptr-for-iid

Arguments
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.
Values
hresult
The hresult.
interface-ptr-for-iid
The new interface pointer or nil if none.
Description

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.

Examples
(query-object-interface foo-impl p-foo 'i-bar)
See also

refguid
hresult


COM/Automation User Guide and Reference Manual - 01 Dec 2021 19:38:38