Главная страница
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.01 c
3-34332
Oxy
2003-04-22 00:21
2003.05.12
Как правильно сделать SQL запрос?


4-34653
JoSHUA
2003-03-12 15:28
2003.05.12
Убийство


4-34645
wadimwlad
2003-03-12 07:39
2003.05.12
WinApi


1-34430
Oleg__
2003-04-28 17:07
2003.05.12
WordApplication


7-34622
Igor_Nickolaev
2003-03-18 16:43
2003.05.12
Можно ли сохранить clipboard на диск?