Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2007 Apr : Event Log

www.cryer.info
Managed Newsgroup Archive

Event Log

Subject:Event Log
Posted by:"KevanB" (kbook..@aulicsystems.co.uk)
Date:Sun, 29 Apr 2007 18:29:18

Hi


Im writing a windows service appliction and need to write to the event log.
I have created a message resource (using Colin Wilsons resource editor)and
included it into application, Ive registered the application in the
registry..


with TRegistry.Create(KEY_READ or KEY_WRITE) do
  try
    RootKey := HKEY_LOCAL_MACHINE;
    if OpenKey('SYSTEM\CurrentControlSet\Services\EventLog\Application\' +
Name, True) then
    begin
      WriteString('EventMessageFile', ParamStr(0));
      WriteInteger('TypesSupported', 7)
    end
  finally
    Free;
  end;

Yet my event entries (      log.LogMessage('TIMER Initiated',
EVENTLOG_INFORMATION_TYPE, 1, 3); ) still look like the following :

The description for Event ID ( 3 ) in Source ( JJM AutoSynch Service )
cannot be found. The local computer may not have the necessary registry
information or message DLL files to display messages from a remote computer.
You may be able to use the /AUXSOURCE= flag to retrieve this description;
see Help and Support for details. The following information is part of the
event: TIMER Initiated.


Clearly, Im missing something and the help,well, doesnt.... could someone
post an example or explain what Ive missed off.


ta


KevanB

Replies:

www.cryer.info
Managed Newsgroup Archive