dynamic insert activex controls into richedit.
SPONSORED LINKS
I have succeed in inserting my control into richedit.
CDrawCtrl is my activex control and it can adjust it’s size by SetInitialControlSize.
————————————————
<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 site of the object 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.
See more here:
dynamic insert activex controls into richedit.