Hello,
While trying to get the nsIFile interface representing the current
working folder:
nsCOMPtr<nsIServiceManager> pServiceMng;
nsCOMPtr<nsIDirectoryServiceProvider> pDirectoryServiceProvider;
nsCOMPtr<nsIFile> pFile;
NS_GetServiceManager(getter_AddRefs(pServiceMng));
pServiceMng->GetServiceByContractID("@mozilla.org/file/directory_service;1",
NS_GET_IID(nsIDirectoryServiceProvider),
getter_AddRefs(pDirectoryServiceProvider));
PRBool persistent = true;
rv = pDirectoryServiceProvider->GetFile(NS_OS_CURRENT_WORKING_DIR,
&persistent, getter_AddRefs(pFile));
I find out that pDirectoryServiceProvider->GetFile(...) returns a false
status. Does anyone know when I went wrong?
Btw, how in general can I get the nsIFile of a file given it full path
in Windows, for example: "c:\myfolder\myfile.dll"
Many thanks in advance for any help...
Regards
Vonuyx
_______________________________________________
Mozilla-xpcom mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-xpcom