Delphi-Quellcode:
procedure TLTC2440_DataList.LoadData(AFileName: String);
var AHStream : THandleStream;
AFileHandle : THandle;
begin
FFileName := AFileName;
Clear;
AFileHandle := CreateFile(PChar(AFileName), GENERIC_READ, FILE_SHARE_READ or FILE_SHARE_WRITE,
0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
if AFileHandle <> INVALID_HANDLE_VALUE then begin
FFileText := TStringList.Create;
try
Im Prinzip kannst'e das noch etwas kürzen.
OPEN_EXISTING beinhaltet ja quasi schon das FileExists.