lodctr Usage (Windows CE 5.0)

Send Feedback

The following example shows the command-line syntax for lodctr.

lodctr MyApplication.ini

The following code example shows the format of the .ini file used by lodctr.

[info]
drivername=Application_Name
symbolfile=SymbolFile
// One key (value optional) for each language supported 
[languages] 
langid=
// Name and description for each counter or counter object
[text]  
offset_langid_NAME=Name         // Counter name string 
offset_langid_HELP=Description  // Help description string 

The following table shows the variables in the .ini file.

Variable Description
DriverName The name of the performance key created under the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services key.
SymbolFile An .h file containing symbolic offsets of counters.

The performance DLL uses the offsets in this file with the First Counter and First Help registry values to determine the indexes of the various counters and counter objects.

Langid An identifier corresponding to the language subkey in the registry.
Offset A symbolic constant defined in SymbolFile.

Offsets must be consecutive, even numbers beginning with zero.

Offsets determine the order in which counters are installed in the Counter and Help values in the registry.

The following code example shows an example SymbolFile.

// SYMFILE.H
#define OBJECT_1    0
#define DEVICE_COUNTER_1    2
#define DEVICE_COUNTER_2    4
The following is an example .ini file.
// begin .ini file example
[info]
drivername=MyApplication
symbolfile=symfile.h
[languages] 
009=English
011=OtherLanguage
[text]  
OBJECT_1_009_NAME=Device Name
OBJECT_1_009_HELP=Displays performance statistics on Device Name
OBJECT_1_011_NAME=Device Name in other language
OBJECT_1_011_HELP=Displays performance of Device Name in other language
DEVICE_COUNTER_1_009_NAME=Counter A
DEVICE_COUNTER_1_009_HELP=Displays the current value of Counter A
DEVICE_COUNTER_1_011_NAME=Counter A in other language
DEVICE_COUNTER_1_011_HELP=Displays the value of Counter A in other language
DEVICE_COUNTER_2_009_NAME=Counter B
DEVICE_COUNTER_2_009_HELP=Displays the current rate of Device B
DEVICE_COUNTER_2_011_NAME=Counter B in other language
DEVICE_COUNTER_2_011_HELP=Displays the rate of Device B in other language

If you run lodctr to add counters to an application and the application does not have a Services subkey, lodctr returns without modifying the Perflib values.

The loading function of lodctr, LoadPerfCounterTextStrings, is declared in Loadperf.h and exported from Loadperf.dll. You can call this function directly from your install program.

The following example shows the syntax for this function.

LONG LoadPerfCounterTextStrings(
LPSTR lpCommandLine, 
BOOL bQuietModeArg 
);

The lpCommandLine parameter is the name of your .ini file.

The bQuietModeArg parameter is a Boolean value that specifies whether to display output during the loading of the text strings for the counter.

If the function succeeds, the return value is ERROR_SUCCESS.

If the function fails, the return value is a nonzero error code defined in the Winerror.h file.

See Also

Removal of Counter Names and Descriptions from the Registry

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.