🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #16210

Unblock thread with PostMessage()?

#16210
From: Peter Stefanos
Date: Tue, 27 May 2003 05:06
24 lines
1927 bytes
Hello,

I am writing a TComPort class that accesses the com port on a PC. (yes I
have used an off the shelf version and I am aware that there are free
classes out there)

I have created a "com port events" thread that monitors com port events
and calls an "event dispatcher" (my own terminology here) from within 
the Synchronize() method. This function (in the main thread) calls the 
users event handler.

My problem is that if the users event handler has a modal pop-up window, 
the com port events thread gets blocked and doesn't call any further 
event handlers.

I have read a few postings about using PostMessage() (no pun intended) 
but I do not know how to implement it without putting the message 
handler method and message map in the users form class manually.

Any ideas? Is this the best way to do this? Is there a simpler way?

Thanks in advance for any help.

Peter.
Technical Details
Message-ID: <3ed2f25e@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,679ed0dfb63f4be3,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-05-26 22:11:45 PST
Date: Tue, 27 May 2003 15:06:17 +1000
From: Peter Stefanos <peterATpennywiseDOTcomDOTau>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01
X-Accept-Language: en-au, en-us
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Unblock thread with PostMessage()?
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 202.45.113.90
Message-ID: <3ed2f25e@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1054011998 202.45.113.90 (26 May 2003 22:06:38 -0700)
Lines: 25
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail