brisco
asked on
ActiveX Control as a container
Hi,
Is it possible to have an activeX control also serve as a container to load other activeX controls? I have manually inserted the correct include in stdafx.h "#include <afxdisp.h>" and called "AfxEnableControlContainer ();" into the control's InitInstance.
The following is a code snippet from a dialog class that that creates the control. If I embed this dialog
class in an .exe, the createcontrol works. If I embed this
dialog class in an activex control, the createcontrol call fails (without returning a meaningful error code).
RECT MySize = {0,0,400,400};
m_nID = 10;
CRuntimeClass* pRuntimeClass = RUNTIME_CLASS( CMsacal70);
m_pCsCRCLD = (CMsacal70*)pRuntimeClass- >CreateObj ect();
BOOL bResult = m_pCsCRCLD->CreateControl( "MSACAL.MS ACALCtrl.7 ",_T(""),W S_VISIBLE, MySize,thi s,m_nID);
if (bResult == FALSE)
{
delete m_pCsCRCLD;
AfxMessageBox("Control creation failed");
}
Is there anything else that needs to be done when an activex
control is being created inside of another activex control?
Can this be done?
Thanks in advance.
Is it possible to have an activeX control also serve as a container to load other activeX controls? I have manually inserted the correct include in stdafx.h "#include <afxdisp.h>" and called "AfxEnableControlContainer
The following is a code snippet from a dialog class that that creates the control. If I embed this dialog
class in an .exe, the createcontrol works. If I embed this
dialog class in an activex control, the createcontrol call fails (without returning a meaningful error code).
RECT MySize = {0,0,400,400};
m_nID = 10;
CRuntimeClass* pRuntimeClass = RUNTIME_CLASS( CMsacal70);
m_pCsCRCLD = (CMsacal70*)pRuntimeClass-
BOOL bResult = m_pCsCRCLD->CreateControl(
if (bResult == FALSE)
{
delete m_pCsCRCLD;
AfxMessageBox("Control creation failed");
}
Is there anything else that needs to be done when an activex
control is being created inside of another activex control?
Can this be done?
Thanks in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER