* Improve Delphi compatibility of TEvent(object) constructors, while keeping also backwards compat by adding default parameters.

This commit is contained in:
marcoonthegit 2022-04-23 17:55:39 +02:00
parent 74f9523806
commit 616538c251

View File

@ -67,7 +67,9 @@ type
FManualReset: Boolean;
public
constructor Create(EventAttributes : PSecurityAttributes;
AManualReset,InitialState : Boolean;const Name : string);
AManualReset,InitialState : Boolean;const Name : string;
UseComWait:boolean=false);
constructor Create(UseComWait : Boolean=false);
destructor destroy; override;
procedure ResetEvent;
procedure SetEvent;
@ -153,7 +155,7 @@ begin
end;
constructor TEventObject.Create(EventAttributes : PSecurityAttributes;
AManualReset,InitialState : Boolean;const Name : string);
AManualReset,InitialState : Boolean;const Name : string;UseComWait:boolean=false);
begin
FHandle := BasicEventCreate(EventAttributes, AManualReset, InitialState, Name);
@ -162,6 +164,13 @@ begin
FManualReset:=AManualReset;
end;
constructor TEventObject.Create(UseComWait : Boolean=false);
// cmompatibility shortcut constructor, Com waiting not implemented yet
begin
Create(nil,True,false,'',UseComWait);
end;
destructor TEventObject.destroy;
begin