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

Помогите с FileRead --->   Найти похожие ветки 

← →
Sir Alex ©   (2003-04-29 17:02) [0]

hdl:=fileopen (flname,fmOpenRead);
iFileLength := FileSeek(hdl,0,2);
FileSeek(hdl,0,0);
Buffer := PChar(AllocMem(iFileLength + 1));
iBytesRead := FileRead(hdl, buffer, iFileLength);
FileClose(hdl);

iBytesRead = 6839 байт, проблема в том, что Buffer, после FileRead становится Inaccessible Value, Почему???


← →
Zz_   (2003-04-29 17:04) [1]

buffer[0]


← →
Skier ©   (2003-04-29 17:04) [2]

iBytesRead := FileRead(hdl, buffer ^, iFileLength); ?


← →
Sir Alex ©   (2003-04-29 17:09) [3]

2 Skier
FileRead(hdl, buffer^, iFileLength); - Pointer type required

2 Zz_
162. Element 0 inaccessible - use "Length" or "SetLength"

Еще есть варианты?


← →
Skier ©   (2003-04-29 17:13) [4]

>Sir Alex

> FileRead(hdl, buffer^, iFileLength); - Pointer type required

Класс ! А я был в полной уверенности что buffer это PChar,
судя по кастингу...мда...


← →
Sir Alex ©   (2003-04-29 17:13) [5]

Сорри обоим, торможу, у меня Buffer был типа string а не PChar :)))



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

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



Память: 0.44 MB
Время: 0.01 c
4-34638
[lamer]Barmaglot
2003-03-11 09:15
2003.05.12
LVM_SetItemcount


7-34633
AlexPro_
2003-03-14 17:21
2003.05.12
Выключение компа из-под Win2000 Adv Serv


14-34613
Soft
2003-04-24 14:03
2003.05.12
Win XP


14-34572
Yanis
2003-04-22 19:11
2003.05.12
Справка по Delphi


4-34644
squab
2003-03-11 23:04
2003.05.12
перетаскивание окна.




   Наверх