Passing CRichEditCtrl pointer to COM
-
Hi, I'm just starting to use COM dlls but have come across what I believe must be a common problem for brainwashed MFC folk... absolutely any suggestions would be welcome! I have a standard Windows app generated using Visual C++ V6.0 which uses a CRichEditCtrl control. The app is served by several COM dlls. I would really like to dedicate one of the COM dlls to displaying the information in the CRichEditCtrl control. The problem is how do I tell the COM dll the pointer to the control?. I have tried passing the control window handle (hwnd) and then using SendMessage(hwnd,,,). Thats OK for raw text but when I want to (say) get the defaultcharformat I really need the control's CRichEditCtrl* pointer. I guess I could pass a void ptr and then cast to CRichEditCtrl* - but this seems to go against good COM practice? Can anybody recommend a COM friendly solution and restore my initial enthusiasm to program with COM! Many Thanks BarryM :sigh:
-
Hi, I'm just starting to use COM dlls but have come across what I believe must be a common problem for brainwashed MFC folk... absolutely any suggestions would be welcome! I have a standard Windows app generated using Visual C++ V6.0 which uses a CRichEditCtrl control. The app is served by several COM dlls. I would really like to dedicate one of the COM dlls to displaying the information in the CRichEditCtrl control. The problem is how do I tell the COM dll the pointer to the control?. I have tried passing the control window handle (hwnd) and then using SendMessage(hwnd,,,). Thats OK for raw text but when I want to (say) get the defaultcharformat I really need the control's CRichEditCtrl* pointer. I guess I could pass a void ptr and then cast to CRichEditCtrl* - but this seems to go against good COM practice? Can anybody recommend a COM friendly solution and restore my initial enthusiasm to program with COM! Many Thanks BarryM :sigh: