Вниз
Скачать: 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 вся ветка

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



Память: 0.44 MB
Время: 0.012 c
14-17325
Zhenka
2003-02-17 06:57
2003.03.06
Не могу разобраться с Ф-ей


7-17404
Groove_
2003-01-07 00:42
2003.03.06
Mouse.visible:=false;


3-16871
VIB
2003-02-18 10:04
2003.03.06
DBGrid


3-16974
AnnReal
2003-02-17 16:26
2003.03.06
Выделение строк в DBGrid двойным щелчком мышы


14-17268
Димаска
2003-02-19 01:24
2003.03.06
Вопрос про свич




   Наверх