Hi,

> 4 - Start your MessageLoop

Or use the messageLoop of TWSocket if you dont need to receive custom
messages. Set Multithreaded to true.

---
Rgds, Wilfried [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
http://www.mestdagh.biz

Wednesday, August 16, 2006, 07:38, Arno Garrels wrote:

> I'm not sure what you try to do, but it's easy:

> 1 - Create the Pop3Cli instance in Execute 
> 2 - Assign properties and events
> 3 - Connect 
> 4 - Start your MessageLoop

> ---
> Arno Garrels [TeamICS]
> http://www.overbyte.be/eng/overbyte/teamics.html


> Patrick Wong wrote:
>> Dear all,
>> 
>> I am using BCB6 and ICS.  I reference The MailRcv application as a
>> start of my new task.  It works fine as long as the Pop3Cli is
>> created and used in the main GUI context.  For my app I need to do
>> the POP3 mail client as a worker thread.  However it does not work as
>> the event Pop3ClientRequestDone can never be triggered.  The symptom
>> is that after calling Connect(), a call to User() throws exception as
>> it is in pop3DnsLookupState.      
>> 
>> I suspect that this is caused by the lack of a message queue in the
>> worker thread. 
>> 
>> As such I try to create a message loop using the ConApp.pas as an
>> example: 
>> 
>> void __fastcall TMailClientThread::MessageLoop(void)
>> {
>>   TMsg *pMsg;
>> 
>>   while(!Terminated && GetMessage(pMsg, 0, 0, 0))
>>   {
>>      TranslateMessage(pMsg);
>>      DispatchMessage(pMsg);
>>   }
>> }
>> 
>> void __fastcall TMailClientThread::Execute()
>> {
>>   this->MessageLoop();
>> 
>>   //---- Place thread code here ----
>>   while(!Terminated)
>>   {
>>      :
>>      :
>>   }
>> }
>> 
>> However the thread execution will not proceed as the TranslateMessage
>> and DispatchMessage will not be reached in the while() within the
>> MessageLoop function call.  
>> 
>> Is there any ICS sample that instructs how to implement a message
>> queue in a threaded application? 
>> 
>> If I am wrong in the above understanding please kindly advise.  I
>> will be happy if there is indeed a simpler solution. 
>> 
>> Thanks in advance.
>> 
>> 
>> 
>> 
>>> --
>>> To unsubscribe or change your settings for TWSocket mailing list
>>> please goto http://www.elists.org/mailman/listinfo/twsocket
>>> Visit our website at http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to