Re: How to PostThreadMessages?
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Mon, 04 Jun 2007 20:38:12 -0400
You can't PostThreadMessage to a thread that does not have a message pump driving it..
Note that since the thread function is static, it has no CWinThread instance that would
allow a CWinThread::PostMessage to have any effect, so the compiler diagnostic is correct.
But if you come up with a workaround for that, then it won't work, because there's no
message pump.
You have to create a UI thread to handle this sort of thing, but it can't be doing
anything else interesting for any long period of time or the thread messages won't be
dequeued.
joe
On Mon, 4 Jun 2007 17:01:04 -0500, "jp2code" <poojo.com/mail> wrote:
I'm trying to create a CWinThread derived class.Joseph M. Newcomer [MVP]
To start the thread using AfxBeginThread, I had to declare my UINT Loop
function as static.
Now, how do I call other parts of my CWinThread derived class?
I have tried using PostThreadMessage, but this is an illegal call of a
non-static member function.
So, how do I call other parts of my class?
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- Follow-Ups:
- Re: How to PostThreadMessages?
- From: jp2code
- Re: How to PostThreadMessages?
- References:
- How to PostThreadMessages?
- From: jp2code
- How to PostThreadMessages?
- Prev by Date: Re: Using the registry in Vista.
- Next by Date: Re: Using the registry in Vista.
- Previous by thread: Re: How to PostThreadMessages?
- Next by thread: Re: How to PostThreadMessages?
- Index(es):
Relevant Pages
|
Loading