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

NextPrevUpTopContentsIndex

query-interface

Function
Summary

Attempts to obtain a COM interface pointer for one interface from another.

Package

com

Signature

query-interface interface-ptr iid &key errorp => interface-for-iid

Arguments

interface-ptr

A COM interface pointer to be queried.

iid

The iid of a COM interface.

errorp

A boolean. The default is t.

Values

interface-for-iid

The new COM interface pointer or nil.

Description

The function query-interface function 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.

If the IUnknown::QueryInterface returns successfully then the new interface pointer interface-for-iid is returned.

If errorp is true, then nil is returned if the interface pointer cannot be found, otherwise an error of type com-error is signaled.

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

refguid
com-error
add-ref
release
with-temp-interface
with-query-interface


LispWorks COM/Automation User Guide and Reference Manual - 14 Feb 2015

NextPrevUpTopContentsIndex