|
||
Each converter DLL requires an associated information file. This file allows the converter architecture to read the properties of the converters in the DLL without having to load the DLL itself.
The information is written in a resource file. It contains:
a single CONARC_RESOURCE_FILE
resource which contains an array of CONVERTER_DATA
resources
each CONVERTER_DATA
resource describes the properties of
a single converter. It specifies the UID of the converter, an array of
MIME
resources describing the data types
from which the converter can convert, and another array of MIME
resources describing the data types to which the converter can convert.
each MIME
resource specifies the supported MIME type,
e.g. text/html
, and an array of LANG_DATA
resources giving localised human-readable
names for that MIME type.
each LANG_DATA
resource specifies a language ID and a
human-readable name for the MIME type in that language
The resource file is included within a start resource ...
end
block in the project file. Its targetpath
should be
\resource\convert\
.
The following example is an information file for a converter DLL that contains one converter:
#include <conplugin.rh>
#include "ExampleConv.hrh"
RESOURCE CONARC_RESOURCE_FILE
{
converter_list=
{
CONVERTER_DATA
{
conv_uid=KExampleConvImplementationUid; // UID of the converter, as returned by CConverterBase2::Uid()
from_list=
{
MIME
{
type="example/qp";
lang_list=
{
// lang_id is a value from the TLanguage enumeration. 01 is English.
LANG_DATA{lang_id=01;translation="quoted-printable";}
};
}
};
to_list=
{
MIME
{
type="example/text";
lang_list=
{
LANG_DATA{lang_id=01;translation="text";}
};
}
};
}
};
}