Previous Thread:   Registry and Save As

9/17/2005 11:17:34 AM    Problem in code to display EVT file contents in Event Viewer
Hi,  
  
I've written code to view the contents of an Event file (.EVT) in  
  
Windows' Event Viewer.  
  
I've created a new Registry entry:  
  
SYSTEM\\CurrentControlSet\\Services\\EventLog\\My_Events.  
  
The "File" subkey of this entry has the value:  
  
%SystemRoot%\system32\config\MyEvent.Evt  
  
(This file name is a #define in the code. So if I want to open  
  
"AnotherEventFile.Evt", I set the #define to this file.)  
  
Now the PROBLEM:  
  
Right after executing my code, I DO NOT see the contents of the EVT  
  
file in Event Viewer. The Registry entry has the correct EVT file  
  
specified, Event Viewer correctly shows a section called "My_Events"  
  
below the "Application", "System" and "Security" sections, and when I  
  
view the properties of "My_Events", the correct EVT file specified is  
  
seen.  
  
ONLY WHEN I RESTART MY SYSTEM DO I SEE THE CONTENTS OF THE FILE.  
  
Why can I not see the EVT file contents right after my code executes??  
  
Is this a refresh problem, in which case some API is to be used to  
  
notify Windows that a Registry value has been updated?  
  
Will be grateful if someone could help me out with this!  
  
Thanks in advance,  
  
Shankar



9/17/2005 1:02:31 PM    Re: Problem in code to display EVT file contents in Event Viewer
No clue about your code. (ask them in one of the dev groups) but make sure  
  
the value "File" is type Reg_Expand_Sz  
  
--  
  
Regards,  
  
Dave Patrick ....Please no email replies - reply in newsgroup.  
  
Microsoft Certified Professional  
  
Microsoft MVP [Windows]  
  
http://www.microsoft.com/protect  
  
"shanks" wrote:

9/18/2005 11:16:22 AM    Re: Problem in code to display EVT file contents in Event Viewer
Thanks, Dave. Yes, I have used "Reg_Expand_Sz".  
  
Will post this question on a Dev group as you say. But if you come up  
  
with some ideas, pls let me know. Thanks.  
  
Dave Patrick wrote:

9/18/2005 12:26:08 PM    Re: Problem in code to display EVT file contents in Event Viewer
You're welcome.  
  
--  
  
Regards,  
  
Dave Patrick ....Please no email replies - reply in newsgroup.  
  
Microsoft Certified Professional  
  
Microsoft MVP [Windows]  
  
http://www.microsoft.com/protect  
  
"shanks" wrote: