Article View: borland.public.cppbuilder.internet.web
Article #493Re: Downloading and resuming
From: Will Bright
Date: Wed, 08 Nov 2006 03:09
Date: Wed, 08 Nov 2006 03:09
24 lines
2032 bytes
2032 bytes
>Have you tried calling GetLastError() yet to find out why it is failing?
Apparently my hFile handle seems to be invalid after I get
here at the HttpAddRequestHeaders() func.
AnsiString Range = ("Range: bytes=" + AnsiString(FileStream->Size) + "-\r\n");
if(!HttpAddRequestHeaders(hFile, Range.c_str(), -1, HTTP_ADDREQ_FLAG_ADD))
ListBox1->Items->Add("HttpAddRequestHeaders() " + SysErrorMessage(GetLastError()));
It doesn't make sense, the handle was closed here \/
InternetCloseHandle(hFile);
hFile = HttpOpenRequest(hSession, "GET", edtURL->Text.c_str(), "HTTP/1.1",
NULL, szAcceptTypes, INTERNET_FLAG_RELOAD, 0);
but the hSession was used to do the InternetConnect() and then
used by the HttpOpenRequest(). I will have to debug a bit more
because I just don't see right now how the handle is becoming
invalid.
Will
Technical Details
Message-ID:
<45515872$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!elnk-atl-nf1!newsfeed.earthlink.net!out01b.usenetserver.com!news.usenetserver.com!in01.usenetserver.com!news.usenetserver.com!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<454f7d80$1@newsgroups.borland.com> <454fa637$1@newsgroups.borland.com> <454fb7d0$1@newsgroups.borland.com> <454fe1a9$2@newsgroups.borland.com> <454ff6ea$1@newsgroups.borland.com> <4550497c@newsgroups.borland.com> <45512485$1@newsgroups.borland.com> <45512675@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,f20f86396ab98121 X-Google-Attributes: gidfeeec,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Will Bright" <no@spam.com> Sender: "Will Bright" <no@spam.com> Reply-To: "Will Bright" <no@spam.com> Subject: Re: Downloading and resuming Newsgroups: borland.public.cppbuilder.internet.web X-User-Info: 66.61.146.24 References: <454f7d80$1@newsgroups.borland.com> <454fa637$1@newsgroups.borland.com> <454fb7d0$1@newsgroups.borland.com> <454fe1a9$2@newsgroups.borland.com> <454ff6ea$1@newsgroups.borland.com> <4550497c@newsgroups.borland.com> <45512485$1@newsgroups.borland.com> <45512675@newsgroups.borland.com> NNTP-Posting-Host: 207.105.83.66 Message-ID: <45515872$1@newsgroups.borland.com> Date: 7 Nov 2006 20:09:22 -0700 X-Trace: newsgroups.borland.com 1162958962 207.105.83.66 (7 Nov 2006 20:09:22 -0700) Lines: 25 Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!elnk-atl-nf1!newsfeed.earthlink.net!out01b.usenetserver.com!news.usenetserver.com!in01.usenetserver.com!news.usenetserver.com!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail