Article View: borland.public.cppbuilder.nativeapi
Article #12231Re: error invlid handle when trying to postthreadmessage
From: Remy Lebeau (TeamB)
Date: Wed, 17 Dec 2003 00:20
Date: Wed, 17 Dec 2003 00:20
34 lines
2098 bytes
2098 bytes
"Mark Di Nicola" <don't@emailback.com> wrote in message
news:3fdf9bb2$1@newsgroups.borland.com...
> the problem is i keep on getting error posting message: error
> invalid thread id.
Where are you getting your ThreadID from to begin with? Are you sure that
the thread is still running at the time that you are posting the message?
Are you sure that PeekMessage() has already been called at least once before
you post the message to the thread?
Have you looked at the latest documentation for PostThreadMessage()? It has
the following notes:
Parameters
idThread
...
Windows 2000/XP: This thread must either belong to the same desktop
as the calling thread or to a process with the same locally unique
identifier (LUID). Otherwise, the function fails and returns
ERROR_INVALID_THREAD_ID.
....
Return Value
...
If the function fails, the return value is zero. To get extended
error information, call GetLastError. GetLastError returns
ERROR_INVALID_THREAD_ID if idThread is not a valid thread identifier, or if
the thread specified by idThread does not have a message queue.
Gambit
Technical Details
Message-ID:
<3fdfa031$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3fdf9bb2$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,6e41c9ea28efb76e X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-12-16 16:39:51 PST From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3fdf9bb2$1@newsgroups.borland.com> Subject: Re: error invlid handle when trying to postthreadmessage Date: Tue, 16 Dec 2003 16:20:30 -0800 Lines: 36 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.1165 NNTP-Posting-Host: 67.23.78.224 Message-ID: <3fdfa031$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1071620145 67.23.78.224 (16 Dec 2003 16:15:45 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail