User manual
47
The name of the .DLL module is constructed as follows:
<COMPONENT-NAME>.DLL
where <COMPONENT-NAME> represents the name of the loadable component. The use
of delimiting characters in <COMPONENT-NAME> (spaces, tabs, and other “invisible”
characters) is not allowed. In case when component is already implemented in CHARON
core and has the name like <COMPONENT-NAME>.DLL but customer wants to create its
own implementation, the following naming convention should be used:
CHAPI_<COMPONENT-NAME>.DLL
2.3 Component loading and initialization
CHARON handles the loading of a component DLL through the Win32 API. This is
implemented by processing a pair of load and set directives in the corresponding
configuration file:
load chapi <CFG-NAME>
set <CFG-NAME> dll=<PATH-TO-DLL>
where <CFG-NAME> and <PATH-TO-DLL> are the relevant values for the component.
After loading the module into memory, the CHARON core creates the necessary context
and calls the module initialization routine.
Note that if a particular CHAPI loadable component is configured to load more than once,
the corresponding .DLL module is loaded only once, but the initialization routine is called
for each configured instance. For example, suppose the configuration file contains the
following lines:
load chapi TTA
set TTA dll=dl11.dll
load chapi TTB
set TTB dll=dl11.dll
Processing the above lines, the CHARON loads the DL11.DLL once, and then calls the
corresponding initialization routine first for logical device TTA and then for TTB.
The moment of calling the initialization routine corresponds to the processing of the set
command, when the value <PATH-TO-DLL> (dl11.dll in this case) is assigned to the dll
parameter.
The module initialization routine has a predefined name and calling conventions, and must
be declared in the source code (assuming the Visual C++ programming language) as
follows:










