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

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

Наверх




Память: 0.47 MB
Время: 0.015 c
1-34493
GEN
2003-04-29 09:32
2003.05.12
компонент TRichEdit


1-34436
Плохой человек
2003-04-28 19:29
2003.05.12
Про события динамически создаваемых компонентов.


4-34641
NAlexey
2003-03-11 14:06
2003.05.12
BorderStyle


1-34446
Viper_
2003-04-29 04:37
2003.05.12
Image


6-34535
alex2003
2003-03-14 06:12
2003.05.12
Отправка SMS