Retrieves an array of information for all filters.
#include "ltwrappr.h"
static L_INT LBaseFile::GetFilterListInfo(ppFilterList, pFilterCount)
Pointer to a pointer to a FILTERINFO structure that represents an array of information for all filters. The address of this structure will be stored into *ppFilterList. This parameter cannot be NULL.
Pointer to a variable to be updated with the number of elements of ppFilterList array.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
The function will allocate a FILTERINFO structure large enough to contain the information of all filters.
When the array ppFilterList is no longer needed, the user is responsible to free this structure by calling the LBaseFile::FreeFilterInfo(*ppFilterList, *pFilterCount, FILTERINFO_FREEALL) function.
To obtain the information for a specific filter, call the LBaseFile::GetFilterInfo function.
To update the information of a specific filter, call LBaseFile::SetFilterInfo function.
To update the filter extension list, be sure to save and restore the original filter list before calling LBaseFile::FreeFilterInfo function.
L_INT LBaseFile__GetFilterListInfoExample()
{
pFILTERINFO pFilterList;
L_UINT uFilterCount;
L_TCHAR* pszOrigExtensionList;
L_INT nRet;
nRet = LBaseFile::GetFilterListInfo(&pFilterList, &uFilterCount);
if(nRet !=SUCCESS)
return nRet;
// Save the original extension list so you can free it later
pszOrigExtensionList = pFilterList[2].pszExtensionList;
//Designate files with extension abc or cba as type 2
pFilterList[2].pszExtensionList = L_TEXT("abc,cba");
// Remove the FILTERINFO_CHECKEDBYFILEINFO flag. This will make the
// LFile::GetInfo function checks for this filter only if the extension is in the extension list that have been set above
pFilterList[2].uFlags = pFilterList[2].uFlags & ~FILTERINFO_CHECKEDBYFILEINFO;
// Update the filter information. Note: This will affect all threads!
nRet =LBaseFile::SetFilterInfo(&pFilterList[2], 1, 0);
if(nRet !=SUCCESS)
return nRet;
// Restore the original extension list
pFilterList[2].pszExtensionList = pszOrigExtensionList;
// Free the pFilterList array that was allocated with LBaseFile::GetFilterListInfo
nRet =LBaseFile::FreeFilterInfo(pFilterList, uFilterCount, FILTERINFO_FREEALL);
if(nRet !=SUCCESS)
return nRet;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document