Click to See Complete Forum and Search --> : NT Event Log Question
I used ReportEvent to write to the NT event log, it's doing it but it contains the following in the log description.
The description for Event ID ( 1 ) in Source ( MyLogger ) could not be found. It contains the following insertion string(s): .
I can get the insertion strings but not the exact description.
Any help??
Thanks in advance.
Please refer to MSDN for reportevent, it needs the following steps:
1. New a symbol DLL project in MSVC
2. Write a log.mc with the MC format
3. mc log.mc
4. rc -r -fo log.res log.rc
5. add log.rc to you dll project
6. build dll project
7. add log.h to your app project, reportevent with eventid define in log.h, not messageid in log.MC
8. new a registry item in \HKEY_LOCAL_MACHINE\SYSTETM\CURRENTCONTROLSET\SERVICE\EVENTLOG\APPLICATION
the itemname should be the same with what you use in RegisterEventSource. And
add the following value
EventMessageFile String the path of your event .dll
TypeSupported DWORD 0x7
format of .MC
;/*++
;
;Copyright (c) 1995-1997 Microsoft Corporation
;
;Module Name:
;
; pop3evnt.h
;
;Abstract:
;
; Definitions for POP3 Server Events
;
;Author:
;
; RichardW, 3 Jan 95
;
;Revision History:
;
;Notes:
;
; This file is generated by the MC tool from the pop3evnt.mc file.
;
;--*/
;
;
;#ifndef __POP3EVNT_H__
;#define __POP3EVNT_H__
;
SeverityNames=(Success=0x0:STATUS_SEVERITY_SUCCESS
Informational=0x1:STATUS_SEVERITY_INFORMATIONAL
Warning=0x2:STATUS_SEVERITY_WARNING
Error=0x3:STATUS_SEVERITY_ERROR
)
MessageId=1000 Severity=Success SymbolicName=POP3EVENT_SERVICE_STARTED
Language=English
The POP3 Service started successfully.
.
MessageId= Severity=Success SymbolicName=POP3EVENT_MAIL_DELIVERED
Language=English
A message was successfully delivered for %1.
.
MessageId=2000 Severity=Informational SymbolicName=POP3EVENT_MAIL_DIRECTORY_CREATED
Language=English
A new mail directory was created for %1.
.
MessageId= Severity=Informational SymbolicName=POP3EVENT_USER_CONNECT
Language=English
A client has connected
.
MessageId= Severity=Informational Symbolicname=POP3EVENT_USER_DISCONNECT
Language=English
A client has disconnected
.
MessageId=3000 Severity=Warning SymbolicName=POP3EVENT_MAIL_DIRECTORY_LOCKED
Language=English
The mail directory for user %1 was locked, and could not be accessed.
.
MessageId= Severity=Warning SymbolicName=POP3EVENT_VOLUME_FULL
Language=English
The volume containing the mail directory, %1, is full.
.
MessageId= Severity=Warning SymbolicName=POP3EVENT_LOGON_FAILURE
Language=English
A logon attempt has failed.
.
MessageId=4000 Severity=Error SymbolicName=POP3EVENT_PARAMETER_MISSING
Language=English
The service is not configured correctly, and data was not found
in the registry for path %1
.
;
;#endif //__POP3EVNT_H__
;
November 20th, 1999, 01:56 AM
Hi
I have got the same problem, if you have the working code with you, pls. send it.
Thanks in advance
Merlion
November 20th, 1999, 02:17 AM
Hi all
I will be thankfull to you, if any one give suggestion on how to display the description part in event log display. For event logging, I am using ReportEvent()...
best wished
Merlion
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.