Not logged in, Join Here! or Log In Below:  
News Articles Search    

 Home / General Programming / Threads and Controls Account Manager
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.

May 06, 2005, 08:19 AM

Problem description:
I have a Dialog with some Controls (EditBox, GridCtrl, ...).
I need to read/set values to theses controls from a created Thread.
On some controls the program crashes (the GridCtrl one e.g.).
The crashes show me that i've forgotten some details which concern calling from a thread.

Btw, my application is "MFC Multithreaded ...DLL"

Any help is welcome.


May 06, 2005, 09:36 AM

It would help to see some source code, since multi-threading issues are usually complex.

Without looking at your code - be sure you're wrapping any control updates in a critical section. In MFC you can use the CCriticalSection object.



May 06, 2005, 10:17 AM

The detail you have forgotton is that MFC is not multithreaded compatible. It is illegal to call any methods of a MFC class instance created by another thread. You can however get the win32 handle to the MFC object and use that with win32 methods.

This thread contains 3 messages.
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.