对话框包含custom control(定制控件)时 对话框无法产生
//一个空的对话框,我让他在组框中显示:
//m_tab_base是一个TabCtrl控件
在oninitdialog()中添加
m_busCon.Create(IDD_BUS_CONDITON,&m_tab_base);
没有添加custom control时没有任何问题
在面板里加了以后调试出错
void CWnd::MoveWindow(int x, int y, int nWidth, int nHeight, BOOL bRepaint)
{
ASSERT(::IsWindow(m_hWnd) || (m_pCtrlSite != NULL)); //这里出错
if (m_pCtrlSite == NULL)
::MoveWindow(m_hWnd, x, y, nWidth, nHeight, bRepaint);
else
m_pCtrlSite->MoveWindow(x, y, nWidth, nHeight);
}
[ 跟踪后发现m_busCon.Create(IDD_BUS_CONDITON,&m_tab_base); 后发现DLG类的hWnd是空的,删除控件后hWnd正常产生;
各位达人,很急啊,我测试了一下 在其他基于对话框的工程建的custom control时没有问题。请各位给个解决办法能正常加载coutom control