question on nsIWeakReference

jml <[email protected]> Sun, 05 Jan 2003 10:15:13 +0800
Newsgroups gmane.comp.mozilla.devel.java,gmane.comp.mozilla.devel.xpcom,gmane.comp.mozilla.devel.embedding
Organization Another Netscape Collabra Server User
Message-ID <[email protected]>
I have some question on nsIWeakReference and nsISupportsWeakReference.

1. How error code should nsIWeakReference.queryReferent() return if the 
corresponding xpcom object is disposed?

2. For the whole design, why require the nsISupportsWeakReference 
interface? I don't see the necessary of the nsISupportsWeakReference 
interface, at least, if one can provide an nsIWeakReference, why care 
about nsISupportsWeakReference?

3. BTW, it is very easy to implement the nsIWeakReference in java, only 
need to use the java weakreference support. Can anyone explain how 
weakreference works in the C/C++ world? I noticed there are a lot of 
C/C++ macro for it, hard to understand for me :-)

Thanks

jml