Support
Joined: 18 Jul 2005 Posts: 731
|
Posted: Tue Oct 20, 2009 5:47 am Post subject: INFO: You get an 'Unknown Error' message when you try to save a file to your namespace extension on Vista or later |
|
|
The solution is to implement the CNSEFolder.GetChildFromDisplayName function on the folder class(es) where you are trying to save as follows (taken from the FileSystemBrowser sample):
Code: | // The GetChildFromDisplayName function is called to retrieve the item from
// its display name. If the e.AssumeChildExists parameter is true, the child with the
// specified display name should be assumed to in existence and an item representing
// that display name should be returned.
CNSEItem* CFolderItem::GetChildFromDisplayName(CGetChildFromDisplayNameEventArgs& e)
{
if(e.assumeChildExists)
{
return new CFileItem(this->fullPath, e.displayName);
}
else
{
// Return only if file truly exists
if(FileExists(PathCombineNSE(this->fullPath,e.displayName)))
{
return new CFileItem(this->fullPath, e.displayName);
}
else if (DirectoryExists(PathCombineNSE(this->fullPath, e.displayName)))
{
return new CFolderItem(this->fullPath, e.displayName);
}
}
return NULL;
}
|
|
|