This function extracts a subfile from a container file to a user-defined path or output stream. This call returns file format information when file is extracted to a path.
int (pascal *fpExtractSubFile) ( void *pFile, KVExtractSubFileArg extractArg, KVSubFileExtractInfo *extractInfo);
pFile
|
The identifier of the file. This is a file handle returned from fpOpenFile(). |
extractArg
|
A pointer to the structure KVExtractSubFileArg, which defines the subfile to be extracted. Before you initialize the |
extractInfo
|
A pointer to the structure KVSubFileExtractInfo , which defines information about the extracted subfile. |
KVERR_Success
. After the file is extracted, call fpFreeStruct() to free the memory allocated by this function.
If the subfile is embedded in the main file as a link and is stored externally, extractInfo->infoFlag
is set to KVSubFileExtractInfoFlag_External
.
For example, the subfile might be an object that was embedded in a Word document by using "Link to File," or an attachment that is referenced in an MBX message. This type of subfile cannot be extracted. You must write code to access the subfile based on the path in the member extractInfo->filePath
or extractInfo->fileName
. See KVSubFileExtractInfo.
KVSubFileExtractInfo extractInfo = NULL; KVStructInit(&extractArg); extractArg.index = index; extractArg.extractionFlag = KVExtractionFlag_CreateDir | KVExtractionFlag_Overwrite; extractArg.filePath = subFileInfo->subFileName; /*Extract this subfile*/ error=extractInterface->fpExtractSubFile(pFile,&extractArg,&extractInfo); if ( error ) { extractInterface->fpFreeStruct(pFile,extractInfo); subFileInfo = NULL; }
|