PDA

View Full Version : How to allocate ActiveX Control in a SECDialogBar at VS2005 ?



cere
03-12-2009, 10:38 PM
Hi,I want to use the toolbar which allocated my own ActiveX Control on SECMDIFrameWnd.

In VC++6.0, application program(based on MDI) running without a problem in the following procedures.

1. Open resource editor and insert resource(DialogBar).
(ID:IDD_DIALOGBAR)
2. Insert ActiveX Control and allocate ActiveX Control on resource editor
3. Insert source code :

MainFrm.h :

SECDialogBar m_dlgBar;

MainFrm.cpp :

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
......
......

if (!m_dlgBar.Create(this,IDD_DIALOGBAR,WS_CHILD|WS_V ISIBLE| CBRS_TOP,NULL, SECControlBar::GetUniqueBarID(this,103)))
{
TRACE("failed tool Bar\n");
return -1;
}

m_dlgBar.EnableDocking(CBRS_ALIGN_TOP);
DockControlBarEx(&m_dlgBar, AFX_IDW_DOCKBAR_TOP, 0, 2, (float)1.0, 54);

return 0;
}

But,In Visual Studio 2005(SP1), An Exception occurs when I used a method previously described.How to allocate ActiveX Control in a SECDialogBar at VS2005 ?

Thanks!