标题: Activex控件的属性类里面如何获得控件类得指针 [打印本页]

作者: 51hei社区    时间: 2016-1-16 03:12
标题: Activex控件的属性类里面如何获得控件类得指针
CGT_ViewCtrl* CGT_ViewPropPage::GetControlClass()
{
    CGT_ViewCtrl *pMyCtrl;
    ULONG Ulong;
   
    // Get the array of IDispatch pointers that is stored in the property page.
    LPDISPATCH FAR *m_lpDispatch = GetObjectArray(&Ulong);
   
    // Get the CCmdTarget object that is associated with any one of the previous
    // array elements.
    pMyCtrl = (CGT_ViewCtrl*) CCmdTarget::FromIDispatch(m_lpDispatch[0]);
   
    // Cleanup
    return pMyCtrl;
}


CGT_ViewPropPage::CGT_ViewPropPage() :
    COlePropertyPage(IDD, IDS_GT_VIEW_PPG_CAPTION)
{
    //{{AFX_DATA_INIT(CGT_ViewPropPage)
    //}}AFX_DATA_INIT

//    m_nCycleTime = 0;
   
//    memset(m_CurrentINFO, 0, sizeof(m_CurrentINFO));
    m_bNeverSelect = false;
   
   
}


http://support.microsoft.com/kb/143432









欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1