|
Prev: Run-time error when Optimization turned on ?
Next: Open .txt file in notepad (Custom Browser - CHtmlView )
From: neilsolent on 18 May 2008 14:03 Hi All In my program (VC++ 6) one thread is using PostThreadMessage to communicate with another thread. The call is intermittently failing, and GetLastError() returns 1444. The target thread has a message queue. However, in response to messages (naturally) it calls other functions, so it may be busy at times before resuming processing. Could this be the cause of the problem? If so, how can this be avoided? thanks, Neil
From: Alex Blekhman on 18 May 2008 14:27 "neilsolent" wrote: > In my program (VC++ 6) one thread is using PostThreadMessage to > communicate with another thread. The call is intermittently > failing, and GetLastError() returns 1444. 1444 means "Invalid thread identifier.". Ensure that you pass valid thread ID to `PostThreadMessage' function. HTH Alex
From: Doug Harrison [MVP] on 18 May 2008 14:55 On Sun, 18 May 2008 11:03:27 -0700 (PDT), neilsolent <neil(a)solenttechnology.co.uk> wrote: >Hi All > >In my program (VC++ 6) one thread is using PostThreadMessage to >communicate with another thread. The call is intermittently failing, >and GetLastError() returns 1444. > >The target thread has a message queue. However, in response to >messages (naturally) it calls other functions, so it may be busy at >times before resuming processing. > >Could this be the cause of the problem? If so, how can this be >avoided? In addition to what Alex said, see if this KB article applies: PRB: PostThreadMessage Messages Lost When Posted to UI Thread http://support.microsoft.com/kb/183116/en-us -- Doug Harrison Visual C++ MVP
From: neilsolent on 18 May 2008 15:05 yeah I know! It's odd - it's an intermittent problem - next post will work OK. The threads are persistent - the same ids for the lifetime of the app.
From: neilsolent on 19 May 2008 03:31
Thanks I have it working now - using PostMessage and creating an invisible window in each thread. |