Platform SDK: TAPI

ITDispatchMapper::QueryDispatchInterface

Returns a dispatch pointer to a different interface on an object given its GUID and the dispatch pointer of another interface on the object.

HRESULT QueryDispatchInterface(
  BSTR pIID,
  IDispatch *pInterfaceToMap,
  IDispatch **ppReturnedInterface
);

Parameters

pIID
[in] Pointer to BSTR representation of GUID for needed interface.
pInterfaceToMap
[in] IDispatch pointer of starting interface.
ppReturnedInterface
[out, retval] IDispatch pointer of interface corresponding the GUID contained in pIID.

Return Values

Value Meaning
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

  Windows NT/2000: Requires Windows 2000.
  Version: Requires TAPI 3.0 or later.
  Header: Declared in Tapi3.h.
  Library: Use T3iid.lib.

See Also

ITDispatchMapper