Login | ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/simple_log_event/trunk/LogTestUsingDelphi/LogWriteTestDelphi.dpr
Revision: 3
Committed: Thu Apr 30 21:30:09 2020 UTC (2 years ago) by daniel-marschall
File size: 807 byte(s)
Log Message:
The event source name can now also be set. Added setup for even more easier installation.

File Contents

# Content
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}
19 x.LogEvent('MySourceName', ViaThinkSoftSimpleLogEvent_TLB.Warning, 'This is a test warning written by Delphi 64 bit');
20 {$ELSE}
21 x.LogEvent('MySourceName', ViaThinkSoftSimpleLogEvent_TLB.Warning, 'This is a test warning written by Delphi 32 bit');
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.