@(none) wrote:
nsCOMPtr<nsIFile> profileDir(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID));
rv = profileDir->InitWithPath(nsDependentCString("/home/adele"));

and got
no matching function for call to `nsDerivedSafe<nsIFile>::
   InitWithNativePath(nsDependentCString)'

You'd need nsILocalFile for that, not nsIFile.
Also, NS_LITERAL_CSTRING is preferred to nsDependentCString for literal strings; and InitWithPath takes a unicode string, so you'd need NS_LITERAL_STRING (note missing C).


However, as you're in C++, you have this nice helper method:
nsCOMPtr<nsILocalFile> result;
nsresult rv = NS_NewLocalFile(NS_LITERAL_STRING("/home/adele", PR_TRUE, getter_AddRefs(result));
if (NS_FAILED(rv)) {
// error handling
}


_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to