Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2004.12.26;
Скачать: CL | DM;

Вниз

Не могу считать файл в буфер!   Найти похожие ветки 

 
Frozzen   (2004-12-10 18:45) [0]

Уже взял текст с хелпа

var
 iFileHandle: Integer;
 iFileLength: Integer;
 iBytesRead: Integer;
 Buffer: PChar;
 i: Integer;
begin
 if OpenDialog1.Execute then
 begin
   try
     iFileHandle := FileOpen(OpenDialog1.FileName, fmOpenRead);
     iFileLength := FileSeek(iFileHandle,0,2);
     FileSeek(iFileHandle,0,0);
     Buffer := PChar(AllocMem(iFileLength + 1));
     iBytesRead := FileRead(iFileHandle, Buffer, iFileLength);
     FileClose(iFileHandle);

     for i := 0 to iBytesRead-1 do
     begin
       ShowMessage(IntToStr(Integer(Buffer[i])));

       при таком обращении выдает ошибку
и дебагером содержимое буфера не отображает
   
     end;
   finally
     FreeMem(Buffer);
   end;
 end;


 
DiamondShark ©   (2004-12-10 18:52) [1]

Не обманывай, ни с какого "хелпа" такую ерунду взять нельзя.

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


 
Frozzen   (2004-12-10 18:57) [2]

Delphi6 help на функцию FileRead example


 
Frozzen   (2004-12-10 18:58) [3]

Delphi6 help на функцию FileRead example


 
Fay ©   (2004-12-10 19:01) [4]

В 5-ке тоже 8)


 
DiamondShark ©   (2004-12-10 19:10) [5]

Ну что ж... От очепяток никто не застрахован.


 
8ung   (2004-12-10 19:14) [6]

Ошибка!
iBytesRead := FileRead(iFileHandle, Buffer^, iFileLength);


 
Fay ©   (2004-12-10 19:15) [7]

2 8ung   (10.12.04 19:14) [6]
Где?!!!
8)


 
8ung   (2004-12-10 19:17) [8]

iBytesRead := FileRead(iFileHandle, Buffer^, iFileLength);
Посмотри, что в примере написано, а что у меня!



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

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

Наверх




Память: 0.48 MB
Время: 0.037 c
9-1093602192
Reflex
2004-08-27 14:23
2004.12.26
вопрос по OleAutomation


3-1101467614
WellSlava
2004-11-26 14:13
2004.12.26
установка формата даты


3-1101498589
SergP
2004-11-26 22:49
2004.12.26
TDBGridEh. Запретить перемещение столбцов. (Повторно)


1-1103056913
Zilog
2004-12-14 23:41
2004.12.26
Интерисует как можно сделать панель типа "Microsoft Office".


1-1103096865
Змей
2004-12-15 10:47
2004.12.26
DriveCombobox