LFileSettings::PreLoadFilters

Summary

Specifies the file format filters to be loaded.

Syntax

#include "ltwrappr.h"

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

Parameters

L_INT nFixedFilters

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

L_INT nCachedFilters

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

L_TCHAR * 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 LFxyzu.dll or LFxyzx.DLL. For instance, if pszFilter is PCX,TIF,CMP then LFPCXu.dll will be loaded then LFTIFu.dll and then LFCMPu.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 LFFPXu.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

Value Meaning
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.

In case the previously loaded DLLs should be changed, call the LFileSettings::GetPreLoadFilters function before calling this function.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

This example preloads the BMP, PCX, and TIFF filters, and allows 1 filter to be cached, while always keeping 2 loaded.

L_INT LFileSettings__PreLoadFiltersExample() 
 
{ 
   L_INT nRet; 
 
   nRet = LFileSettings::PreLoadFilters( 2, 1, TEXT("BMP,PCX,TIF")); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   //... 
 
   return SUCCESS; 
} 

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.