Article View: borland.public.cppbuilder.internet.socket
Article #364Stop the indy Get() function
From: bar
Date: Wed, 26 Mar 2008 17:24
Date: Wed, 26 Mar 2008 17:24
31 lines
1780 bytes
1780 bytes
Hi All,
If i am calling HTTP->Get(); in main GUI thread and placed TldAntiFreeze
component on the form.
I have a pop-up menu on the form. Each menu item call the following function
to download the .bmp file from the webserver.
void TfrmMain::DownloadFile(String URL)
{
try
{
ErrFile = "";
AnsiString FileName = "SomeFileName.bmp";
std::auto_ptr<TFileStream> strm(new TFileStream(FileName,fmCreate));
HTTP->Request->Pragma = "no-cache";
HTTP->HandleRedirects = true;
HTTP->ReadTimeout = 15000;
HTTP->Get(URL, strm.get());
}
catch(const Exception &E)
{
ErrFile = E.Message;
}
1.I am download a file of 1MB, the process is in progress. I want to set an
option if another menu item is selected while downloading. I want to cancel
the previous download completely, without raising the exception or giving my
own message.
Technical Details
Message-ID:
<47ea86a8@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!eweka.nl!lightspeed.eweka.nl!feeder.erje.net!news.isoc.lu!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 11508e,8732be4783ae43b6,start X-Google-Attributes: gid11508e,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "bar" <shaikakbar250281@yahoo.co.in> Newsgroups: borland.public.cppbuilder.internet.socket Subject: Stop the indy Get() function Date: Wed, 26 Mar 2008 20:24:04 +0300 Lines: 33 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 NNTP-Posting-Host: 62.150.201.142 Message-ID: <47ea86a8@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1206552232 62.150.201.142 (26 Mar 2008 10:23:52 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!eweka.nl!lightspeed.eweka.nl!feeder.erje.net!news.isoc.lu!newsgroups.borland.com!not-for-mail