CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Guest

    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.


  2. #2
    Guest

    Re: NT Event Log Question

    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__
    ;



  3. #3
    Guest

    Re: NT Event Log Question

    Hi

    I have got the same problem, if you have the working code with you, pls. send it.
    Thanks in advance



  4. #4
    Join Date
    Nov 1999
    Posts
    1

    Re: NT Event Log Question

    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



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured