Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Threads and message dispatching

Status
Not open for further replies.

foxjoker

Programmer
Jul 5, 2000
22
US
Hi !
I made an application that uses 2 threads, getting data from the port and decoding them before displaying them. But it crashes after a time, and the debugger indicates that the error occurs in CWnd::OnWndMsg. When I reduce the number of messages sent by my threads, the error happens later, but still happens.

Do you have an explanation, and maybe a solution to that problem ?
 
Hi!

Whats the error! What messages are you sending!

-pete
 
Well, I send WM_PAINT and WM_VSCROLL messages... The error is that a pointer, used by the OnWndMsg function, seems to be empty ( the memory could not be read ).

Is it enough clear ? Maybe should I note the exact words.
 

> Is it enough clear ?
No

> Maybe should I note the exact words.

Don't know what that means.

> Well, I send WM_PAINT

Show the code that sends the WM_PAINT message, however I can tell you that if you are using MFC CWnd class and calling their PostMessage or SendMessage functions, that will not work.

The MFC CWnd class uses thread local storage to map the HWND's to the class instances. There are a number of technical articles on MSDN regarding that subject

Hope this helps
-pete

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top