MFC thread affinity and COM
-
avoid using MFC in COM srevers as it has thread affinity. wot does this means exactly . !!! Thanks in advance.
-
This should help. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_Multithreading.3a_.Programming_Tips.asp[^]
-- signature under construction --
-pete
-
most of the MFC objects internally uses local thread storage extensively. so they are bound to their owner thread, and not supposed to be shared with other threads. this is why MFC has thread affinity.
It's not a bug, it's an undocumented feature.
suhredayan@gmail.com -
To have thread affinity means to be "bound to the thread". Therefore the object can only be used safely from that thread. In the case of MFC, some objects are bound to threads through MFCs use of Thread Local Storage. Attempting to use the object in a thread other than the thread it is bound to will result in errors since the thread local storage data is not present. Hope that helps?
-- signature under construction --
-pete