Writing A Readlog Extension To View Custom Events (Windows Embedded CE 6.0)
1/5/2010
To have the Readlog Viewing Tool read custom events, and print the data in the way you want, you can create a Readlog extension. If you prefer, you can modify sample code for a Readlog plug-in to create the extension DLL for Readlog.exe.
To create a Readlog extension DLL to parse data into a string
Open a command-line window on your development workstation, and type
set _WINCEROOT=<your root directory> %_WINCEROOT%\public\common\oak\misc\wince.bat NT cebase DESKTOP
This creates a desktop build window.
Navigate to %_WINCEROOT%\PUBLIC\COMMON\SDK\SAMPLES\CELOG. Locate the sample plug-in in the READERPLUGIN\DEMO subdirectory. Use this sample as a model to create your own readlog plug-in.
To return the whole list of events from the GetEvents function, set NUM_EVENTS and then fill the buffer with your list.
Add a case for each event to the GetEventString function.
This function takes the buffer of your data and fills a string with your user-readable interpretation of the data.
For each case you created in step 4, copy the clauses in the sample that read from pInBuf and write to szMsg.
The sample code sets szMsg to MAX_PATH, but this value can be enlarged to suit your requirements.
Set dwMsgLen to the length, in characters, of the string output message*.*
When you are done implementing your plug-in, at a command-line window, type
build
After you make these changes to the sample plug-in, the rest of the sample code handles any other standard requirements.
The Readlog executable noted in step 2 builds to a file named cplgdemo.dll in %_WINCEROOT%\release\DESKTOP\NT\. If you build a custom extension, the extension is also stored in %_WINCEROOT%\release\DESKTOP\NT\.
To use the extension you created, you must add it to the registry of your development workstation. For information about configuring Readlog to use the output from your extension, see Viewing Output from a Readlog Extension.
See Also
Tasks
Capturing Events With Custom Data Structures