alpha version, October 2000
Generally, the filters are placed in DLLs. The framework will scan standard places for DLLs with standard names and UIDs (descibed below), and all the conversion DLLs are loaded automatically. The framework supports loading the DLLs on demand: only the filter DLLs are loaded as soon as the conversion tools are initialized. The--generally big--conversion libraries are loaded only when (or if) they are really needed.
All the filter DLLs are placed in the "/System/XConversion/Filters" folders, on any disk. The framework would search all disks, and any DLL found there will be loaded in. Besides, some DLLs in subfolders might be loaded as well; see "bundles" below.
The library should export one function at the ordinal number 1. The function allocate and return the filter object(s) for the filter(s), contained in the library: in case the DLL exports just one filter, it will be returned directly; otherwise a CXArray of all the exported filters is assumed. Each process, which uses the library, will call the function just once; then it will use the filter object(s) "forever". Generally, the task deletes the filter objects just before it ends; but since a task can be killed, there is no way to ensure that (!). Therefore, the filter object destructor should not contain any vital code; just freeing the occupied memory (which would be freed at the task end anyway).
Some filters might need diverse supporting files. There can be resources, needed for the conversion "details" dialogue; a filter with complex conversions would place them to DLLs apart, to save time and memory whenever the filter DLL is loaded. There might be conversion tables, generated document templates, or other data. So as they don't get mixed with the conversion DLLs, a bundle mechanism is used. A bundle is just a folder with any name and with a suffix of "XConversion". Inside it must be the filter DLL, with the same name as the bundle name, and with a suffix "Dll". This DLL will be automatically loaded, just the same way as if it was placed directly in the "/System/XConversion/Filters" folder. If this file does not exist, the bundle is ignored.
The CXCFilter class will offer a few service methods to easily access the files in the bundle.
Copyright © 1999-2000 X.soft, all rights reserved