Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2003.08.21;
Скачать: 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 вся ветка

Текущий архив: 2003.08.21;
Скачать: CL | DM;

Наверх




Память: 0.46 MB
Время: 0.019 c
7-68572
Pliajnik
2003-06-07 12:35
2003.08.21
Как распечатать на принтере StringGrid c данными?


8-68411
Rradion
2003-04-23 14:23
2003.08.21
Где в Delphi живёт PaintBox ???


14-68513
Yuraz
2003-08-05 16:51
2003.08.21
MicroSoft при установке Win98 и др. считывает с БИОС дату


3-68183
KONST
2003-07-28 17:42
2003.08.21
Помогите новичку. Как с помощью IBDatabase подключиться к базе.


14-68484
Vlad Oshin
2003-08-06 09:08
2003.08.21
о как бывает :)