On Thu, Jul 15, 2004 at 04:09:05AM -0700, yueweng wrote:
> if (aIID.Equals(NS_GET_IID(nsSupportsWeakReference))) {
^^^^^^^^^^^^^^^^^^^^^^^
Hmm, that's no interface... I'd use nsISupportsWeakReference.
> *aInstancePtr = (void*) NS_STATIC_CAST(nsISample*,this);
> *aInstancePtr = (void*) NS_STATIC_CAST(nsISample*,this);
> *aInstancePtr = (void*) NS_STATIC_CAST(nsISample*,this);
You need to cast to the interface that the caller requested. Doing it
this way, it is no surprise that the crash happens.
However, why not just use:
NS_IMPL_ISUPPORTS4(nsSampleImpl, nsIWebProgressListener,
nsISupportsWeakReference, nsIObserver, nsISample)
(if you do that, you have to remove NS_IMPL_ADDREF and NS_IMPL_RELEASE)
--
_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom