Using the Threads Module with MFC
You may not access and should not attempt to create MFC objects from within threads created using the Threads Module runnable object classes. The MFC library relies on thread-local storage to store handles to any underlying Windows objects that were created within a given thread. The MFC class, CWinThread, creates this thread-local storage when it launches a thread. The restriction on access also applies to MFC threads; one thread may not access an MFC object created by another thread. If you need to manipulate a Windows object encapsulated by an MFC object instance created by another thread, you will need to acquire a handle to underlying Windows object and use that handle to manipulate the object directly.
Although you are not allowed to manipulate MFC instances from the Threads Module, you may still use the Threads Module synchronization and communication mechanisms with threads created by MFC and CWinThread.