Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. ReportEvent

ReportEvent

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorial
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    Yashusid
    wrote on last edited by
    #1

    Hi ALL, I am inserting my entry into the "Application" event log for Windows, thro, ReportEvent as follows, bRet = ::ReportEvent( m_hEventSource, wEventType, 0, //event category INF_DUMMY, psidCurrUser, 1, 0, (LPCTSTR*)&lptszMessage, NULL ); it does one entry into the event log successfully. but if i see the "Category" column in the event log its displayed as "None", here i want to display some text(such as "Test category"), If anyone know how to do it, please help me.

    R 1 Reply Last reply
    0
    • Y Yashusid

      Hi ALL, I am inserting my entry into the "Application" event log for Windows, thro, ReportEvent as follows, bRet = ::ReportEvent( m_hEventSource, wEventType, 0, //event category INF_DUMMY, psidCurrUser, 1, 0, (LPCTSTR*)&lptszMessage, NULL ); it does one entry into the event log successfully. but if i see the "Category" column in the event log its displayed as "None", here i want to display some text(such as "Test category"), If anyone know how to do it, please help me.

      R Offline
      R Offline
      Rajkumar R
      wrote on last edited by
      #2

      Hi, Iam not very familiar to this. But I found in MSDN that for event id , categories you need to register message files EventMessageFile, CategoryMessageFile, and ParameterMessageFile to the registry. Please search the msdn for messages files. Since you passed 0 in the category it displayed none. Best Regards Raj

      Y 1 Reply Last reply
      0
      • R Rajkumar R

        Hi, Iam not very familiar to this. But I found in MSDN that for event id , categories you need to register message files EventMessageFile, CategoryMessageFile, and ParameterMessageFile to the registry. Please search the msdn for messages files. Since you passed 0 in the category it displayed none. Best Regards Raj

        Y Offline
        Y Offline
        Yashusid
        wrote on last edited by
        #3

        Yes i have created a message dll. and i have given it as MessageId=1 Facility=FACILITY_CHECK SymbolicName=CATEGORY1 Language=English Category 1 in mc file. during call to ReportEvent, if i give bRet = ::ReportEvent( m_hEventSource, wEventType, CATEGORY1, //category INF_DUMMY, psidCurrUser, 1, 0, (LPCTSTR*)&lptszMessage, NULL ); category column is not displaying with what text i have given for CATEGORY1. it displaus as "Devices" in category column....

        R 1 Reply Last reply
        0
        • Y Yashusid

          Yes i have created a message dll. and i have given it as MessageId=1 Facility=FACILITY_CHECK SymbolicName=CATEGORY1 Language=English Category 1 in mc file. during call to ReportEvent, if i give bRet = ::ReportEvent( m_hEventSource, wEventType, CATEGORY1, //category INF_DUMMY, psidCurrUser, 1, 0, (LPCTSTR*)&lptszMessage, NULL ); category column is not displaying with what text i have given for CATEGORY1. it displaus as "Devices" in category column....

          R Offline
          R Offline
          Rajkumar R
          wrote on last edited by
          #4

          Have you correctly set the registry keys for the event source, particularly the "CategoryMessageFile" and its count. And also if you define all the event, category and parameter in a single file the category must be the first. -- modified at 9:21 Monday 25th June, 2007

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups