LFileSettings::GetPreLoadFilters
#include "ltwrappr.h"
static L_SSIZE_T LFileSettings::GetPreLoadFilters(pszFilters, uSize, pnFixedFilters, pnCachedFilters)
|
L_TCHAR * pszFilters; |
/* pointer to a character string to be updated with filters */ |
|
L_SIZE_T uSize; |
/* size in bytes of pszFilters */ |
|
L_INT * pnFixedFilters; |
/* pointer to a variable to be updated */ |
|
L_INT * pnCachedFilters; |
/* pointer to a variable to be updated */ |
Retrieves the current preloaded filters list.
|
Parameter |
Description |
|
pszFilters |
Pointer to a character string to be updated with the current preloaded filters list. |
|
uSize |
The size in bytes of the buffer pointed to by pszFilters. |
|
pnFixedFilters |
Pointer to a variable to be updated with the number of filters that should stay loaded in memory at all times. Pass NULL if it is not required. |
|
pnCachedFilters |
Pointer to a variable to be updated with the number of filters that should be loaded. Pass NULL if it is not required. |
Returns
|
>=0 |
The size in bytes of the preloaded filters list. |
|
< 0 |
An error occurred. Refer to Return Codes. |
Comments
In case the current preloaded filters list should be changed, call this function before calling the LFileSettings::PreloadFilters function.
The preload filters list contains the list of fixed and cached filters. For more information, refer to LFileSettings::PreloadFilters.
To retrieve the preloaded filters list, the user should:
|
1. |
Call the function passing pszFilters as NULL and uSize as 0 to retrieve the size required for the filters list as returned value. |
|
2. |
Allocate a buffer of size (Returned Value * sizeof(L_TCHAR)). |
|
3. |
Call the function passing the allocated buffer to the pszFilters and the returned value to uSize to retrieve the filters list. |
Required DLLs and Libraries
|
LTFIL For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
See Also
|
Functions: |
LFileSettings::PreLoadFilters, LFileSettings::IgnoreFilters, LFileSettings::GetIgnoreFilters, Class Members |
|
Topics: |
|
|
|
Example
L_INT LFileSettings__GetPreLoadFiltersExample()
{
L_TCHAR * pszList = NULL;
L_INT nFixed;
L_INT nCached;
L_SIZE_T nRet;
LBitmap Bitmap;
L_TCHAR buf[80];
/* get the original filters list */
nRet = LFileSettings::GetPreLoadFilters(NULL, 0, NULL, NULL);
pszList = (L_TCHAR *)malloc(nRet*sizeof(L_TCHAR));
nRet = LFileSettings::GetPreLoadFilters(pszList, nRet, &nFixed, &nCached);
::MessageBox(NULL, pszList, TEXT("TEST"), MB_OK);
free(pszList);
wsprintf(buf, TEXT("fixed: %ld, cached: %ld"), nFixed, nCached);
::MessageBox(NULL, buf, TEXT("TEST"), MB_OK);
/* change the preload filters */
/* This example preloads the TGA, PCX and TIF filters */
/* and allows 1 filter to be cached, while always */
/* keeping 2 loaded. */
LFileSettings::PreLoadFilters( 2, 1, TEXT("TGA,PCX,TIF"));
/* get the new filters list */
nRet = LFileSettings::GetPreLoadFilters(NULL, 0, NULL, NULL);
pszList = (L_TCHAR *)malloc(nRet*sizeof(L_TCHAR));
nRet = LFileSettings::GetPreLoadFilters(pszList, nRet, &nFixed, &nCached);
::MessageBox(NULL, pszList, TEXT("TEST"), MB_OK);
free(pszList);
wsprintf(buf, TEXT("fixed: %ld, cached: %ld"), nFixed, nCached);
::MessageBox(NULL, buf, TEXT("TEST"), MB_OK);
/* try to load TGA */
nRet = Bitmap.Load(TEXT("d:\\temp\\test.tga"));
if(nRet == SUCCESS)
::MessageBox(NULL, TEXT("TGA loaded"), TEXT("TEST"), MB_OK);
}