« XPCOM API Reference
Summary
The QueryReferent method queries an interface on the referent if it exists, and like nsISupports::QueryInterface, produces an owning reference to the desired interface.
void QueryReferent(
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_NULL_POINTER
- The referent no longer exists.
- NS_ERROR_NO_INTERFACE
- The requested interface is not available.
Remarks
The caller of QueryReferent should not hold on to the produced interface permanently; that would defeat the purpose of using a non-owning nsIWeakReference in the first place.