Accessing MFC-Objects from other threads than the primary
I'm using a graphics library within an application. Functions of the library were accessed from a different than the application's primary thread. There were crashes which could be traced back to the said library. The developer told me that there are problems when functions are called from other threads. That's not my problem at this point - But: Are there any general restrictions for MFC- or Win32-Objects when being accessed from other that the main thread? If there are any, is there a good source for retrieving further information?
Thanks for any support in advance!
Re: Accessing MFC-Objects from other threads than the primary
Are there any general restrictions for MFC- or Win32-Objects when being accessed from other that the main thread?
For MFC window objects, yes there is. And no there's not for Win32 objects. MFC window object is restricted to be used only in the thread it was created in, and therefore must not be called across threads. However, window handle wrapped by the MFC object can be used across threads without any limitation.
Bookmarks