Требуется открыть бинарный файл и заполнить массив переменных типа word. Вот мой код:
Код:
var
OpenDialog :TOpenDialog;
kt:Cardinal;
filehandle: THandle;
file_inf: TOFStruct;
buf: array of word;
begin
openDialog := TOpenDialog.Create(self);
openDialog := TOpenDialog.Create(self);
if openDialog.Execute
then begin
filehandle := OpenFile(PChar(openDialog.FileName),file_inf,OF_READWRITE);
size := GetFileSize(filehandle,nil);
SetLength(buf,size div 2 + 1 );
ReadFile(filehandle,buf,size,kt,nil);
CloseHandle(FileHandle);
end;
end;
Админ: Пользуемся тегами для оформления кода!
Вопрос: почему массив остается незаполненным?