A variable which is bound to the queried interface pointer while the forms are evaluated.
A symbol which names the COM interface. It is not evaluated.
A boolean indicating whether an error should be signaled if interface-name is not implemented by interface-ptr.
A symbol which will be defined as a local macro, as if by macrolet
as if by with-com-interface
. The macro can be used by the forms to invoke the methods on punknown.
A form which is evaluated to yield a COM interface pointer to query.
A form to be evaluated.
The macro with-query-interface
calls query-interface
to find an interface pointer for interface-name from the existing COM interface pointer interface-ptr. While evaluates the forms, the variable punknown is bound to the queried pointer and the pointer is released when control leaves the body (whether directly or due to a non-local exit).
If errorp is true, then punknown is bound to nil
if the interface pointer cannot be found, otherwise an error of type com-error
is signaled.
If dispatch is specified, then a local macro is created as if by with-com-interface
to invoke COM interface methods on punknown.
This example invokes the methods on an i-bar
interface pointer queried from an existing interface pointer.
(with-query-interface (p-bar i-bar
:dispatch call-bar)
p-foo
(call-bar bar-init)
(call-bar bar-print))
LispWorks COM/Automation User Guide and Reference Manual - 14 Feb 2015