Mozilla.com

« XPCOM API Reference

Summary

The getInterface method provides access to other interfaces.

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

Parameters

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

Exceptions Thrown

NS_ERROR_NO_INTERFACE
The requested interface is not available.

Remarks

getInterface is very similar to QueryInterface. The main difference is that interfaces returned from getInterface are not required to provide a way back to the object implementing nsIInterfaceRequestor. The semantics of QueryInterface dictate that given an interface A that you QueryInterface on to get to interface B, you must be able to QueryInterface on B to get back to A. nsIInterfaceRequestor, however, allows you to obtain an interface C from A that may (or most likely) will not have the ability to get back to A.

Page last modified 06:19, 13 Dec 2005 by DarinFisher

Files (0)