在视中显示一个ActiveX控件的属性页

类别:VC语言 点击:0 评论:0 推荐:

     -- lostall

    利用IOleObject::DoVerb达到这一目的。
   
关键代码:
//显示控件的属性对话框
void CShowPropPageView::OnShowPropPage(WPARAM wParam, LPARAM lParam)
{
CMyActiveX  *pCtrl = (CMyActiveX*)wParam;
LPUNKNOWN   pUnk   = pCtrl->GetControlUnknown();
if  (pUnk == NULL)
    return;

IOleObject *pObject=NULL;
if  (FAILED(pUnk->QueryInterface(&pObject)))
    return;

pObject->DoVerb(OLEIVERB_PROPERTIES, NULL, NULL, 0, this->m_hWnd, NULL);
pObject->Release();
}

本文地址:http://com.8s8s.com/it/it3672.htm