
Problem with rich edit control and com
I have a dialog box that has a rich edit control on it. My application uses
COM. I call AfxInitRichEdit in the app's InitInstance(..) method. I call
the rich edit's Create(..) method in the dialog's InitDlg(..) method.
Everything works just fine if I call CoInitialize(NULL) intimating the STA.
But if I call CoInitializeEx(NULL,COINIT_MULTITHREADED), then the Create(..)
method of the CRichEditCtrl fails (during debugging, I noticed that the
failure was actually coming from the OnNcCreate(..) message handler).
Although I don't have an outstanding COM call and I have no interface
pointers, out of desperation I did try the work around suggested in KB
Q166132 - but that did not solve anything. Does the ES_EX_NOCALLOLEINIT
style apply in RichEdit 2.0, or is that a RichEdit 1.0 only style?
My app is absolutely thread safe - so I used Free Threading for performance.
I have little or no desire to put the COM and Rich Edit control in different
threads just to get the OleInitialize to work in the control. Any
suggestions would be greatly appreciated.
roy fine