作一个具有WS_CHILD属性的对话框,无标题栏,生成CDialog类CInbox,并在CInboxCtrl.h中声明CInbox m_inbox;
在activex控件作如下操作
int CInBoxCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
if (COleControl::OnCreate(lpCreateStruct) == -1)
return -1;

BOOL bReturn = m_inbox.Create(WS_CHILD | WS_BORDER | WS_VISIBLE | LVS_REPORT, CRect(0, 0, 10, 10), this, 0x4001);
return 0;
}
void CInBoxCtrl::OnDraw(
CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
{
m_inbox.MoveWindow(rcBounds, TRUE);
}
这时,你在CInbox中绘制什么都可以了,因为它是CDialog