Article View: borland.public.cppbuilder.internet.socket
Article #2215Re: Strange problem when using Indy 9 ftp/http
From: David Ayre
Date: Thu, 20 Jul 2006 17:21
Date: Thu, 20 Jul 2006 17:21
45 lines
2448 bytes
2448 bytes
Thanks Remy, I'll have a look at those points. However, it does seem to stop before the http gets going. Just running the mouse pointer over the form sets it going. As to putting it in a separate thread. I haven't used threads. Could you give me a few pointers on how to do this, please. Cheers, David "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> wrote: > >"David Ayre" <davidcayre@ntlworld.com> wrote in message >news:44bf7f5b$1@newsgroups.borland.com... > >> The application then downloads a file from my website. However, >> what happens on other computers is that the form appears and >> remains blank until I move the mouse pointer over it. Then it >> springs into life. > >Indy is a blocking library. Since you are using it in the main thread, >while it is downloading, the message queue cannot process new messages, >including painting messages. Either drop a TIdAntiFreeze onto the form, or >else call the form's Update() method in the TIdHTTP's OnWork events, or else >move the TIdHTTP to a separate thread. > >> Application->HandleMessage(); > >You are processing only a single message, not all pending messages. Call >ProcessMessages() instead of HandleMessage(). > >> sprintf(acCaption,"Downloading %s",acFile); >> Label1->Caption = acCaption; > >Try calling the form's Update() method just before calling TIdHTTP::Get(). >That will update the form's display just before TIdHTTP then blocks the >message queue. > > >Gambit > >
Technical Details
Message-ID:
<44bfbb8c$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<44bf7f5b$1@newsgroups.borland.com> <44bfa799$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,360df355476f8a7a X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "David Ayre" <davidcayre@ntlworld.com> Sender: "David Ayre" <davidcayre@ntlworld.com> Reply-To: "David Ayre" <davidcayre@ntlworld.com> Subject: Re: Strange problem when using Indy 9 ftp/http Newsgroups: borland.public.cppbuilder.internet.socket X-User-Info: 62.252.224.18 X-Forwarded-For: 81.96.132.239 References: <44bf7f5b$1@newsgroups.borland.com> <44bfa799$1@newsgroups.borland.com> NNTP-Posting-Host: 207.105.83.66 Message-ID: <44bfbb8c$1@newsgroups.borland.com> Date: 20 Jul 2006 10:21:16 -0700 X-Trace: newsgroups.borland.com 1153416076 207.105.83.66 (20 Jul 2006 10:21:16 -0700) Lines: 46 Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail