Please help with MFC cross-threaded window access
I cannot figure out how to solve this one problem for my life... I have an MFC CRichEditCtrl that I would like to change the text of from another thread in my application. This thread consists of a CALLBACK function that's being used for SetWindowsHookEx. If you've done C++ Windows hooking before, you know exactly what I'm talking about.
My instinctive reaction is to make the CRichEditCtrl be public and static (and maybe make the Dialog that it's in be static too), but obviously that hasn't worked out very well for me. I've also tried making static "access" functions and such.
I prefer not to have some lame workaround like magically passing in a pointer to my CALLBACK function or anything. Maybe I could access properties in the Dialog by accessing the current Dialog running, from "theApp" (which is declared inside "[ProgramNameHere].cpp")?
Yes, I've Googled this problem, looked at MSDN documentation, etc. etc. etc. If you know the answer, please give me a simple explanation of how I can access the CRichEditCtrl in my Dialog.