Вниз
Скачать: 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.45 MB
Время: 0.008 c
6-34533
IL-89
2003-03-16 17:26
2003.05.12
Disconnect


1-34476
galexis
2003-04-29 13:23
2003.05.12
Не работает OnKeyDown на клавишу Tab


14-34618
Дмитрий К.К.
2003-04-23 06:13
2003.05.12
Именинники 23 апреля


7-34637
opoloXAI
2003-03-18 12:52
2003.05.12
Просмотр бинарного файла


3-34359
AleksChern
2003-04-22 16:09
2003.05.12
Нестандартная сортировка. Помогите !!!!




   Наверх