ReportEvent
. The main idea is to encode optional insertion arguments in the message file in both human and machine readable formats. The human readable format consists of a tail added to the SymbolicName
. The machine readable format is the same used with printf
. It is stored as a different language resource. For example: MessageId = SymbolicName = MESSAGE_NAME_sdM Language = English The arguments are %1 and %2. The system said "%3". . Language = Format %s%d%M .
This allows to log with the same ease as fprintf
cd logevent mc -v -U msgs.mc brc32 -32 -r msgs.rc bcc32 -tWM -v -I. -c -DTEST_MAIN w32event.c ilink32 /r /v /Tpe d:\borland\BCC55\Lib\c0x32.obj w32event.obj,w32event.exe,w32event.map,cw32.lib import32.lib,,msgs.res w32event
cd logevent mc -U msgs.mc rc -r msgs.rc link -dll -noentry -out:msgs.dll msgs.res cl -DTEST_MAIN w32event.c w32event msgs.dllNote: running the test will register the event source. I haven't been able to build msgs.dll with Borland, suggestions appreciated. To use the code, compile it without defining TEST_MAIN and link to your app.