XLL+ Class Library (6.3)

ModulePropertyConfigurator::configure

Configures the logging framework

static bool configure(
   HINSTANCE hinstance,
   bool bIgnoreMissingFile,
   std::basic_string<TCHAR>& strErrorString,
   bool& bConfigFileWasMissing,
   std::basic_string<TCHAR>& strConfigFile,
   bool& bErrorFileWritten,
   const TCHAR* strErrorFileName,
   std::basic_string<TCHAR>& strErrorFilePath
);

Parameters

hinstance

The module of the binary file (EXE, DLL or XLL) whose location and name controls the location and name of the configuration file.

bIgnoreMissingFile

If true, then a missing configuration file is not considered an error, and in this event true will be returned. If false, then the configuration file must be present; if it is not found, the function will return false.

strErrorString

If an error occurs, a description of the problem will be placed in this variable, and false will be returned. If no error occurs, strErrorString will be cleared.

bConfigFileWasMissing

This parameter will be set to true if the required configuration file was not found. If the file was found, it will be set to false.

strConfigFile

This variable will contain the full path of the configuration file which the configurator searched for, and may have loaded or attempted to load.

bErrorFileWritten

This parameter will be set to true if an error occurred, and information about the failure was written to an error file. The full name and path of the error file will be found in strErrorFilePath. If no error occurred, or if no error file name was specified, then, it will be set to false.

strErrorFileName

The name (excluding path) of an error file where configurator errors will be reported. If this is not specified, then errors will be written only to strErrorString.

strErrorFilePath

If an error occured, and strErrorFileName is specified, then this variable will contain the full path of the error file to which errors were written. The error file will always be located in the current user's temporary directory.

Return Value

If the method returns false, an error occurred, and a description can be found in errorString.

Remarks

The configuration file is expected to be in the same directory as the executing module. Its name should be the same as the executing module, with the addition of the suffix .log.ini. For example, a module MyLib.dll will search for a log configuration file MyLib.dll.log.ini and a program program.exe will search for a log configuration file program.exe.log.ini.

For the format of the configuration file, see Configuration files.

Requirements

Header: cpplog.h

See Also

ModulePropertyConfigurator Class | ModulePropertyConfigurator Methods