An interface pointer can be queried to discover if the underlying object supports other interfaces. This is done using the function query-interface, passing the interface pointer and the refiid of the interface to query. A refiid is either a foreign pointer to a GUID structure or a
naming a COM interface as described in The mapping from COM names to Lisp symbols.
For example, the function below will find the COM interface pointer for itsi-dispatch interface:
(defun find-dispatch-pointer (ptr)
(query-interface ptr 'i-dispatch))
The macro with-query-interface can be used to query an interface pointer and automatically release it again on exit from a body of code.