Subversion Repositories simple_log_event

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 daniel-mar 1
program LogWriteTestDelphi;
2
 
3
{$APPTYPE CONSOLE}
4
 
5
{$R *.res}
6
 
7
uses
8
  System.SysUtils,
9
  ActiveX,
10
  ViaThinkSoftSimpleLogEvent_TLB in '..\TLB\ViaThinkSoftSimpleLogEvent_TLB.pas';
11
 
12
var
13
  x: IViaThinkSoftSimpleEventLog;
14
begin
15
  try
16
    CoInitialize(nil);
17
    x := CoViaThinkSoftSimpleEventLog.Create;
18
    {$IFDEF WIN64}
3 daniel-mar 19
    x.LogEvent('MySourceName', ViaThinkSoftSimpleLogEvent_TLB.Warning, 'This is a test warning written by Delphi 64 bit');
2 daniel-mar 20
    {$ELSE}
3 daniel-mar 21
    x.LogEvent('MySourceName', ViaThinkSoftSimpleLogEvent_TLB.Warning, 'This is a test warning written by Delphi 32 bit');
2 daniel-mar 22
    {$ENDIF}
23
    x := nil;
24
    //CoUninitialize; // TODO: If I do this, I get an access violation at process end?!
25
  except
26
    on E: Exception do
27
      Writeln(E.ClassName, ': ', E.Message);
28
  end;
29
end.