Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2003.03.06;
Скачать: CL | DM;

Вниз

Access Violation: проблемы с HttpQueryInfo   Найти похожие ветки 

 
smok_er   (2003-01-17 13:11) [0]

Мастера, вот код:

function HeadInetFile(const fileURL: String): String;
var
hSession, hURL: HInternet;
dwBuffer: Pointer;
dwBufferLen, dwIndex: DWord;
begin
Result := "";

try
hSession := InternetOpen("Updater", INTERNET_OPEN_TYPE_DIRECT, nil, nil, 0);

hURL := InternetOpenURL(hSession, PChar(fileURL), nil, 0, 0, 0);

dwBuffer := nil;
dwIndex := 0;
dwBufferLen := 100;

if HttpQueryInfo(hURL, HTTP_QUERY_ETAG, @dwBuffer, dwBufferLen, dwIndex) then
Result := PChar(dwBuffer);
finally
if Assigned(hURL) then InternetCloseHandle(hURL);
InternetCloseHandle(hSession);
end;
end;


проблема в том, что постоянно вылетает сабж, причем на самой послдней строчке.
Может кто знает, что делать?
Очень нужно!


 
smok_er   (2003-01-17 13:23) [1]

Нашел ответ сам. Если кому интересно:


function HeadInetFile(const fileURL: String): String;
var
hSession, hURL: HInternet;
dwBuffer: array[1..20] of char;
dwBufferLen, dwIndex: DWord;
begin
Result := "";

try
hSession := InternetOpen("Updater", INTERNET_OPEN_TYPE_DIRECT, nil, nil, 0);

hURL := InternetOpenURL(hSession, PChar(fileURL), nil, 0, 0, 0);

dwIndex := 0;
dwBufferLen := 20;

if HttpQueryInfo(hURL, HTTP_QUERY_ETAG, @dwBuffer, dwBufferLen, dwIndex) then
Result := PChar(@dwBuffer);
finally
if Assigned(hURL) then InternetCloseHandle(hURL);
InternetCloseHandle(hSession);
end;
end;


 
Anton   (2003-01-17 13:39) [2]

Что такое сабж



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

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

Наверх




Память: 0.47 MB
Время: 0.017 c
1-17057
dimdimka
2003-02-24 10:34
2003.03.06
Как хранить текст в рисунке BMP и читать его от туда?


14-17375
AK-74
2003-02-18 19:41
2003.03.06
Есть здесь студенты СГУ?


3-16970
Антон.
2003-02-14 09:40
2003.03.06
Посчитать сумму столбца


1-17026
Ravshan
2003-02-25 10:03
2003.03.06
как можно заставить combobox реагировать на OnMouseDown и т.д.


14-17391
iusup
2003-02-19 01:33
2003.03.06
Нужна прога руссификации InstallShield Express