Oliveiros Cristina wrote:
I have already tried to use the nsIServiceManager::GetService() method using
the CID {0xedb0490e, 0x1dd1 , 0x11b2, {0x83, 0xb8, 0xdb, 0xf8 , 0xd8, 0x59,
0x06, 0xa6}}. But unfortunately the there were no improvements....
Your code snippet is not large enough to help diagnose the problem. What
type is "spiGestorDownload"? What linking strategy are you using? If you're
using the standalone glue, have you called XPCOMGlueStartup() successfully?
unRetVal = spiServManager ->
GetServiceByContractID("@mozilla.org/download-manager;1",
NS_GET_IID(nsIDownloadManager),
getter_AddRefs(spiGestorDownload));
I have already tried to call it this way
unRetVal = spiServManager ->
GetServiceByContractID("@mozilla.org/download-manager;1",
NS_GET_IID(nsISupports),
getter_AddRefs(spiGestorDownload));
The typical pattern is nsCOMPtr<nsISomeInterface> myptr =
do_GetService("@mozilla.org/contractid");
This pattern ensures that the NS_GET_IID matches the type of the comptr.
--BDS
_______________________________________________
Mozilla-xpcom mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-xpcom