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

Thread: NT Event Log

  1. #1
    Join Date
    Aug 1999
    Location
    Australia
    Posts
    4

    NT Event Log

    Event Viewer in NT has a facility to call a registered Application DLL. Where does one find the interface specifications for this user supplied DLL


  2. #2
    Join Date
    Apr 1999
    Location
    Toronto, ON
    Posts
    713

    Re: NT Event Log

    I do nothing about it. Where comes this info from?

    Dmitriy, MCSE

  3. #3
    Join Date
    Aug 1999
    Location
    Australia
    Posts
    4

    Re: NT Event Log

    This is to allow the Event Viewer to use a message file to format and display event data as per RegisterEventSource()


  4. #4
    Join Date
    Apr 1999
    Location
    Toronto, ON
    Posts
    713

    Re: NT Event Log

    Yes, but I found nothing about dll.
    I think you can just use Event Viewer to log your events by using RegisterEventSource(), ReportEvent(), ..., no more.
    Event Viewer does not generate any messages.


    Dmitriy, MCSE

  5. #5
    Join Date
    Aug 1999
    Location
    Australia
    Posts
    4

    Re: NT Event Log

    while not having the dll or exe linked allows you add to the event log, the message "The description for Event ID ( 1 ) in Source ( App Name ) could not be found." will be included in error message. It is this section the the DLL helps format and provides the user with relevant information.

    ie VirusScan NT McShield service started - scanning for 45212 viruses.
    Extra driver name : none



  6. #6
    Join Date
    Apr 1999
    Location
    Toronto, ON
    Posts
    713

    Re: NT Event Log

    Ok, it is interesting question. What coul I find:
    1) I try this code:
    char* lpBuf=(char*) malloc(80);
    strcpy(lpBuf,"Test");
    HANDLE h=RegisterEventSource(NULL,AfxGetAppName());
    ASSERT(h);
    BOOL bRet=ReportEvent(h,EVENTLOG_INFORMATION_TYPE,
    IDE_TEST,//for test
    IDE_TEST, // event identifier
    NULL, // user security identifier (optional)
    1, // number of strings to merge with message
    0, // size of binary data, in bytes
    (LPCTSTR*) &lpBuf, // array of strings to merge with message
    NULL);
    bRet=CloseEventLog(h);

    but it does not work.
    Something from Microsoft knowledgebase:
    "A version of the Logging sample failed to include the .RC file as part of the build in the makefile. So the DLL is built, but no message resources were included in the build. Some developers have tried to include the .BIN file, which is output from the message compiler, as the resource. This does not properly bind the resource to the DLL. You must use the .RC file that is output from the message compiler because it marks the resource with ID of 1 and of type 11 (RT_MESSAGETABLE). This is required for Event Viewer to find the message resources.
    "
    I think the problem near.
    The article is Q166902


    Dmitriy, MCSE

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