Unable to retrieve the complete description string of the event log record

Posted by Santosh Pillai on Stack Overflow See other posts from Stack Overflow or by Santosh Pillai
Published on 2010-03-19T13:44:52Z Indexed on 2010/03/19 13:51 UTC
Read the original article Hit count: 374

Hi All,

I have an MFC application that reads and displays event log records using the ::ReadEventLog() API. The problem is with reading the "Description" message string of the event log record. The MFC application is unable to read the complete "Description" message string and displays only some part of it. However the Windows System Event Log Viewer reads and displays the complete "Description" message string correctly.

I have ensured that my MFC application reads the entire "Description" message string by retrieving all the strings as provided by the "NumStrings" and "StringOffset" member variables of the EVENTLOGRECORD structure and merging all of them. Also as mentioned in MSDN my application loads the Source Name specific message library file (whose path is specified in the registry at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application[SourceName]) that further contains additional message string information and merges it with the earlier read strings.

I am still unable to get the entire "Description" message string.

Please provide any help towards resolving the issue.

Regards,

Santosh.

© Stack Overflow or respective owner

Related posts about mfc

Related posts about windows-registry