Главная страница
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.012 c
1-68309
Ткаченко Сергей
2003-08-06 14:23
2003.08.21
Поиск файлов в директории


6-68430
k$v
2003-06-15 21:41
2003.08.21
Нужен простейший пример использования INDY ...


7-68561
_ALEXey_
2003-06-06 09:19
2003.08.21
Информация по раскладкам клавиатуры


7-68571
dRake
2003-06-07 00:49
2003.08.21
Загруженность проца, как определить?


14-68482
VEG
2003-08-04 19:33
2003.08.21
Издевательства над винчестером