Platform SDK: Exchange Server |
The EventLogMsg function logs an event to the event log, and, optionally, logs the original error(s) that caused the event.
Header file: | EDKEVENT.H |
Library: | EDKEVENT.LIB |
Unicode: | Yes |
VOID EventLogMsg( DWORD dwEvent, DWORD cStrings, {text string parameters}, DWORD cErrorCodes, {error code parameters} );
None.
Each of these strings and error codes are used as parameters to the message in their order of appearance. This means that all of the error-message replacement parameters in event messages must have higher numbers than all of the string replacement parameters. For example:
EventLogMsg(MYAPP_CANNOT_COPY_FILE, 2, pszSourceFile, pszDestFile, 1, dwError);
The message would be defined as:
MessageId= Severity=Error Facility=Application SymbolicName=MYAPP_CANNOT_COPY_FILE Language=English Cannot copy file from %1 to %2 due to the following error:%n%3.
The error code count and error code list are required after the text string count and text string list. Failure to include the error code argument(s) may cause unexpected results.
This routine preserves the last error value returned by the MAPI IMAPIProp::GetLastError method.
For information on the IMAPIProp::GetLastError method, see the MAPI Programmer's Reference.
HrEventCloseLog, HrEventGetCounts, HrEventGetHandle, HrEventOpenLog, HrEventUseExisting