Subversion Repositories simple_log_event

Rev

Rev 2 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 3
Line 7... Line 7...
7
uses
7
uses
8
  System.SysUtils,
8
  System.SysUtils,
9
  ActiveX,
9
  ActiveX,
10
  ViaThinkSoftSimpleLogEvent_TLB in '..\TLB\ViaThinkSoftSimpleLogEvent_TLB.pas';
10
  ViaThinkSoftSimpleLogEvent_TLB in '..\TLB\ViaThinkSoftSimpleLogEvent_TLB.pas';
11
 
11
 
12
const
-
 
13
  LOGEVENT_MSG_SUCCESS       = 0;
-
 
14
  LOGEVENT_MSG_INFORMATIONAL = 1;
-
 
15
  LOGEVENT_MSG_WARNING       = 2;
-
 
16
  LOGEVENT_MSG_ERROR         = 3;
-
 
17
 
-
 
18
var
12
var
19
  x: IViaThinkSoftSimpleEventLog;
13
  x: IViaThinkSoftSimpleEventLog;
20
begin
14
begin
21
  try
15
  try
22
    CoInitialize(nil);
16
    CoInitialize(nil);
23
    x := CoViaThinkSoftSimpleEventLog.Create;
17
    x := CoViaThinkSoftSimpleEventLog.Create;
24
    {$IFDEF WIN64}
18
    {$IFDEF WIN64}
25
    x.LogEvent(LOGEVENT_MSG_WARNING, 'This is a test warning written by Delphi 64 bit');
19
    x.LogEvent('MySourceName', ViaThinkSoftSimpleLogEvent_TLB.Warning, 'This is a test warning written by Delphi 64 bit');
26
    {$ELSE}
20
    {$ELSE}
27
    x.LogEvent(LOGEVENT_MSG_WARNING, 'This is a test warning written by Delphi 32 bit');
21
    x.LogEvent('MySourceName', ViaThinkSoftSimpleLogEvent_TLB.Warning, 'This is a test warning written by Delphi 32 bit');
28
    {$ENDIF}
22
    {$ENDIF}
29
    x := nil;
23
    x := nil;
30
    //CoUninitialize; // TODO: If I do this, I get an access violation at process end?!
24
    //CoUninitialize; // TODO: If I do this, I get an access violation at process end?!
31
  except
25
  except
32
    on E: Exception do
26
    on E: Exception do