Visit Mozilla.org

nsISupports:QueryInterface

From MDC

« XPCOM API Reference

Contents

[edit] Summary

The QueryInterface method provides runtime type discovery.

void QueryInterface(
  in nsIIDRef aIID,
  [iid_is(aIID), retval] out nsQIResult aResult
);

[edit] Parameters

aIID
[in] The IID of the requested interface.
aResult
[out] The resulting interface pointer.

[edit] Return Values

This method does not return a value.

[edit] Exceptions Thrown

NS_ERROR_NO_INTERFACE
The requested interface is not available.

[edit] Remarks

The interface pointer, aResult, returned by QueryInterface must be released by a call to Release when it is no longer needed. QueryInterface is a symmetric, transitive, and reflexive operator.