Hi
Using UNavServicesDialogs::AskSaveFile Function, I am trying to
save file.
After calling this function i get FSSpec , then using following method
i m trying
to get fullpath of the selected file. But sometimes the Mac ( OS X
10.3.2) gets
hang, application not responding.
Please suggest whats wrong with the following method...
Thanks in advance.
static bool GetFullPathWithString( const FSSpec& theSpec, std::string&
outPath )
{
OSStatus error = noErr;
Handle fullPath = NULL;
short fullPathLength;
outPath.clear();
error = ::FSpGetFullPath( &theSpec, &fullPathLength, &fullPath
); // Get full path to file
//error = ::GetFullPath(theSpec.vRefNum, theSpec.parID,
theSpec.name, &fullPathLength, &fullPath);
if(( error != noErr ) && ( fullPath == NULL ))
{
outPath = "";
return false;
}
outPath.append( *fullPath, fullPathLength );
::DisposeHandle( fullPath );
fullPath = NULL;
return true ;
}


|