Nanjun Hu wrote:
Could you tell me how I can know the return value of
AddProgressListener, besides using the NS_SUCCEEDED macro or compared
it with NS_OK?

It's an unsigned long... you could, for example, write it to the file you open, or check the value in a debugger...

I attached all the resouce code with this email. The code is very
short, just trying the same part of code of prefetch by Darin. Thank
you very much for your help.

I found the problem: AddProgressListener does this: 886 nsWeakPtr listener = do_GetWeakReference(aListener); 887 if (!listener) { 888 return NS_ERROR_INVALID_ARG; 889 }

In other words: your component must implement nsISupportsWeakReference. See http://www.mozilla.org/projects/xpcom/weak_references.html

Note that nsPrefetchService does implement this.
_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to