Article View: borland.public.cppbuilder.internet.socket
Article #5495Re: TIdMappedPop3's IdMappedPop31OutboundData() event
From: Remy Lebeau (TeamB)
Date: Thu, 12 Aug 2004 17:07
Date: Thu, 12 Aug 2004 17:07
31 lines
2035 bytes
2035 bytes
"MwnN" <MwnN@localhost.com> wrote in message
news:411b3d04$1@newsgroups.borland.com...
> I have no idea how to append the data back to
> the thread after editing it,or if I even can
Simply assign the new data back to the NetData property.
> AThread->Suspend();
There's no need to suspend the thread. In fact, you should not being doing
so. The OnOutboundData event is triggered in the context of the specified
AThread, thus the thread is already blocked while the event handler is
running. If you call Suspend(), you are effectively suspending the event
handler from finishing its work at all.
> Memo1->Lines->Add(AThread->NetData);
> int iStart = Memo1->Lines->IndexOf("Status:"); // start of body
That code is not thread-safe. You cannot safely directly access the GUI
from event handlers that are run within the context of worker threads. You
need to use the thread's Synchronize() method to access the GUI in a
thread-safe manner.
> But it just seems to freeze the program
As well it should, because that is exactly what you are telling it to do.
Gambit
Technical Details
Message-ID:
<411ba3a0$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news.zanker.org!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<411b3d04$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,b7c52388824192d X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com> Newsgroups: borland.public.cppbuilder.internet.socket References: <411b3d04$1@newsgroups.borland.com> Subject: Re: TIdMappedPop3's IdMappedPop31OutboundData() event Date: Thu, 12 Aug 2004 10:07:25 -0700 Lines: 33 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <411ba3a0$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1092330400 68.69.17.41 (12 Aug 2004 10:06:40 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news.zanker.org!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail