ITDispatchMapper::QueryDispatchInterface method (tapi3if.h)

The QueryDispatchInterface method returns a dispatch pointer to a different interface on an object given its GUID and the dispatch pointer of another interface on the object.

Syntax

HRESULT QueryDispatchInterface(
  [in]  BSTR      pIID,
  [in]  IDispatch *pInterfaceToMap,
  [out] IDispatch **ppReturnedInterface
);

Parameters

[in] pIID

Pointer to BSTR representation of GUID for needed interface.

[in] pInterfaceToMap

IDispatch pointer of starting interface.

[out] ppReturnedInterface

IDispatch pointer of interface corresponding the GUID contained in pIID.

Return value

This method can return one of these values.

Return code Description
S_OK
Method succeeded.
E_OUTOFMEMORY
Insufficient memory exists to perform the operation.
E_INVALIDARG
The pIID parameter either is not a valid BSTR or does not translate into a valid GUID.
E_NOINTERFACE
The interface requested is not exposed or the object does not implement the IObjectSafety interface.

Remarks

The application must use SysAllocString to allocate memory for the pIID parameter and use SysFreeString to free the memory when the variable is no longer needed.

The Dispatch Mapper will use the object's IObjectSafety interface to make sure the object is safe for scripting on the requested interface. If the object does not implement IObjectSafety, or if the object is not safe on this particular interface, the call will fail.

Requirements

Requirement Value
Target Platform Windows
Header tapi3if.h (include Tapi3.h)
Library Uuid.lib
DLL Tapi3.dll

See also

ITDispatchMapper