Original Post
We''ve had the question come up a couple of times on "how to manipulate an object in the thread that didn''t create it", and the general answer is, "you can''t". The reason for this is that MFC keeps its CWnd map in thread-local storage.
However, I was reading Blaszczak''s "Professional MFC w/ VC6.0" this weekend and came across this passage:
"...you can''t create C++ objects to resemble Windowsobjects in one thread and then use the C++ object in another. The reason for this is that MFC manages both the permanent map and the temporary map in storage that''s local to each thread. If you need to do this kind of thing, you should first make sure your design is really as sane as you think it should be--do many threads really need to be playing with a single window? If you''re sure that''s the way to go, you must pass the handle to the window from one thread to another and Attach() it in both threads separately."
So it appears it is possible, though possibly ill-advised (I tend to agree with that, at least). I haven''t researched this personally, but I thought I''d just throw that out on a Monday morning. =)