Вниз
Скачать: 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 вся ветка

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



Память: 0.46 MB
Время: 0.044 c
1-1102921992
KEBZ
2004-12-13 10:13
2004.12.26
Memo


1-1102584959
cr0ck
2004-12-09 12:35
2004.12.26
Как добавить в CLX приложение поддержку WMF/EMF


14-1102322607
Суслик
2004-12-06 11:43
2004.12.26
Delphi 2005


3-1101740218
изм
2004-11-29 17:56
2004.12.26
Подключение к MS SQL c помошью dbExpress


1-1102888330
Bobby Digital
2004-12-13 00:52
2004.12.26
Цвет




   Наверх