LFileSettings::PreLoadFilters

#include "ltwrappr.h"

static L_INT LFileSettings::PreLoadFilters(nFixedFilters, nCachedFilters, pszFilters)

L_INT nFixedFilters;

/* number of filters that stay loaded */

L_INT nCachedFilters;

/* number of filters that are loaded, but may be unloaded later */

L_TCHAR L_FAR * pszFilters;

/* character string containing filters */

Specifies the file format filters to be loaded.

Parameter

Description

nFixedFilters

Number of filters that should stay loaded in memory at all times.

nCachedFilters

Number of filters that should be loaded, but can be unloaded later to make room for other filters.

pszFilters

Character string containing the filters which should be loaded. If pszFilters is NULL, all file filters LEADTOOLS can find will be loaded and LEADTOOLS will determine the order in which the files will be used. pszFilters is in the form xyz, yuv... where XYZ are the 3 letters describing the file filter as in LFxyz13W.DLL or LFxyz14n.dll. For instance, if pszFilter is PCX,TIF,CMP then LFPCX14n.dll will be loaded then LFTIF14n.dll and then LFCMP14n.dll will be loaded. The first nFixedFilters will stay in memory at all times, then the next nCachedFilters will be loaded. However, if other filters will be needed, the cached filters might be unloaded to make room for the new DLLs. It is recommended that the most commonly used DLLs be loaded as fixed to minimize the time required to load/unload file filters. Also, some DLLs may require additional DLLs (like the LFAVI14n.dll or LFFPX14n.dll) so the exact number of DLLs loaded is not necessarily nFixedFilters + nCachedFilters. For more information on available DLLs, refer to Files To Be Included With Your Application.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Some operating systems (like Windows 95) have a limit for the number of DLLs that can be loaded at a time and that limit can be quickly reached, especially if there are several other third party libraries loading DLLs, or if the programming environments themselves load many DLLs. You can use this function to restrict the number of file import/export DLLs that LEADTOOLS will load. Note that the fewer DLLs loaded, the slower the loading/saving of files will be, since there will be more loading/unloading of DLLs.

Please note that LFileSettings::PreLoadFilters has effect only if called before the first time you try to load, save or get information about a file. If you try to load, save or get information about a file without calling LFileSettings::PreLoadFilters first, LEAD loads default filters. For more information, refer to Loading File Filters.

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::IgnoreFilters, Class Members

Topics:

Raster Image Functions: Input/Output File Filters

Example

L_VOID MyFunc()
{
   //This example preloads the BMP, PCX, and TIFF filters, and allows 1 filter to be cached, while always keeping 2 loaded.
   LFileSettings::PreLoadFilters( 2, 1, TEXT("BMP,PCX,TIF"));

   //…
}