| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | Newsletters | VB Forums | Developer.com |
|
|||||||
| Visual C++ Programming Ask questions about Windows programming with Visual C++ and help others by answering their questions. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
dynamic insert activex controls into richedit.
dear friends:
I have succeed in inserting my control into richedit. CDrawCtrl is my activex control and it can auto adjust it's size by SetInitialControlSize AND SetControlSize. ------------------------------------------------ <CODE> CDrawCtrl *pCDrawCtrl = new CDrawCtrl ; for(int i = m_iMaxControlID; i < 6666; i++) { if(NULL == GetDlgItem(i)) break; } m_iMaxControlID = i; pCDrawCtrl->Create("", WS_CHILD, CRect(0, 0, 0, 0),this, m_iMaxControlID); </CODE> ------------------------------------------------ then I insert the pCDrawCtrl with REOBJECT. The problem is that everything I draw in CDrawCtrl::OnDraw will draw not only in the rect provided by richedit with richedit but also in the rect which is defined in <CODE> pCDrawCtrl->Create("", WS_CHILD, CRect(0, 0, 0, 0),this, m_iMaxControlID); </CODE> when I double click in the rect provided by richedit the focus may be with this rect. Then I can not select the object by click the rect provided by richedit. Anyone help me? Thanks. Last edited by sm_ch; December 8th, 2009 at 01:02 AM. Reason: error |
![]() |
| Bookmarks |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|