Article View: borland.public.cppbuilder.nativeapi
Article #14818Re: Creating Message Queue For a thread
From: Remy Lebeau (TeamB)
Date: Wed, 30 Jul 2003 16:48
Date: Wed, 30 Jul 2003 16:48
27 lines
2038 bytes
2038 bytes
"Burak ulutoprak" <bulutoprak@hotmail.com> wrote in message
news:3f27b1dd$1@newsgroups.borland.com...
> ( I change the definition of BEGIN_MESSAGE_MAP to
> #define MY_BEGIN_MESSAGE_MAP virtual void __fastcall Dispatch(tagMSG
> *Message) { switch (Message->message) {
> which causes problem with threads and I have no problem with that part. )
You should stop using MESSAGE_MAPs. I already explained to you earlier that
they do not work for threads. Sending messages to threads is not handled
the same way as sending mesages to windows/components.
TThread derives from TObject, which already has a Dispatch() method. If you
are going to makeshift your own MESSAGE_MAP, then you should name your
dispatching message to something else.
> The problem is I think there is no message queue, so
> the messages coming when processing others are not pooled.
Did you actually create the message queue before trying to use it? Call
PeekMessage() before entering your while() loop:
PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE);
Gambit
Technical Details
Message-ID:
<3f27f591@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3f27b1dd$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,157dc011cd880c13 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-07-30 09:48:19 PST From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f27b1dd$1@newsgroups.borland.com> Subject: Re: Creating Message Queue For a thread Date: Wed, 30 Jul 2003 09:48:45 -0700 Lines: 29 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 207.175.226.26 Message-ID: <3f27f591@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1059583377 207.175.226.26 (30 Jul 2003 09:42:57 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail