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

NextPrevUpTopContentsIndex

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

The COM object class name of the object. This can be a superclass name.

object

A COM object to be queried.

iid

The iid of a COM interface.

ppv-object

If specified, this should be a foreign pointer which will be set to contain the interface-ptr-for-iid.

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 the given iid. The iid can be a symbol naming a COM interface or a refguid foreign pointer containing its iid.

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.

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

refguid
hresult


LispWorks COM/Automation User Guide and Reference Manual - 23 Mar 2017

NextPrevUpTopContentsIndex