Home > Software engineering >  Duilib CActiveXUI problem
Duilib CActiveXUI problem

Time:05-07

When I was in add CActiveXUI controls has been written in the XML file cldis and controls the name,
 & lt; HorizontalLayout> 

Then at the time of the initial control
 void CMainFrame: : InitWindow () 
{
//bound controls a pointer
UI_BINDCONTROL (CButtonUI m_Close, _T (" Close "));
//UI_BINDCONTROL (COptionUI m_pOptionSynUi,)
UI_BINDCONTROL (CActiveXUI m_pCActiveXUI, "IO_OCX");
If (m_pCActiveXUI)
{
_DBIO_InjectModel * CActiveUIObject=NULL;//this is my ocx control class,
M_pCActiveXUI - & gt; GetControl (IID_IUnknown, (LPVOID *) & amp; CActiveUIObject);
If (CActiveUIObject!=NULL)
{
CActiveUIObject - & gt; BIO_DNXK_SetActBtnShow (1);
}
}
//the progress bar
//m_pProgress - & gt; The SetTimer (1, 200);


}

GetControl problem in this function
Below is the function implementation:
 
HRESULT CActiveXUI: : GetControl (const IID IID, LPVOID * ppRet)
{
ASSERT (ppRet!=NULL);
ASSERT (* ppRet==NULL);
If (ppRet==NULL) return E_POINTER;
If (m_pUnk==NULL) return E_PENDING;//return directly here also, m_pUnk this pointer to an empty
Return m_pUnk - & gt; PpRet QueryInterface (iid, (LPVOID *));
}

Don't know is what I call the wrong order or other reasons cause I'm trying to display a OCX control page program crashes, don't know if you have met,
  • Related