Вниз
Скачать: CL | DM;

Работа с файлами   Найти похожие ветки 

← →
SergeyI ©   (2003-06-20 11:26) [0]

Уважаемые ALL, помогите решить проблему не могу прочитать файл
вот код

var
iFileHandle: Integer;
iFileLength: Integer;
iBytesRead: Integer;
Buffer: PChar;
i: Integer ;
begin
try
iFileHandle := FileOpen(FiName, fmOpenRead);
iFileLength := FileSeek(iFileHandle,0,2);
FileSeek(iFileHandle,0,0);
Buffer := PChar(AllocMem(iFileLength + 1));
iBytesRead := FileRead(iFileHandle, Buffer, iFileLength);
( iFileHandle)
Уважаемые ALL, помогите решить проблему не могу прочитать файл
вот код

var
iFileHandle: Integer;
iFileLength: Integer;
iBytesRead: Integer;
Buffer: PChar;
i: Integer ;
begin
try
iFileHandle := FileOpen(FiName, fmOpenRead);
iFileLength := FileSeek(iFileHandle,0,2);
FileSeek(iFileHandle,0,0);
Buffer := PChar(AllocMem(iFileLength + 1));
iBytesRead := FileRead(iFileHandle, Buffer, iFileLength);
FileClose(iFileHandle);

после выполнения Buffer= "" iBytesRead = 0


← →
Palladin ©   (2003-06-20 11:48) [1]

iBytesRead := FileRead(iFileHandle, Buffer^, iFileLength);

iBytesRead=0 тебе повезло и программа не сглючила ибо ничего не прочиталось...



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.44 MB
Время: 0.019 c
14-68508
Pauk
2003-08-05 18:27
2003.08.21
Встроенный checkbox


7-68564
sergwolf
2003-06-06 20:17
2003.08.21
Как считать с COM порта информацию?


1-68379
Borealis
2003-08-07 22:13
2003.08.21
Caption для кнопок


3-68198
ray_w
2003-07-25 19:40
2003.08.21
DBGrid?


8-68409
Denis
2003-04-07 08:55
2003.08.21
Как вручную добавить изображение в ImageList?




   Наверх