一个主框架D,下面一个DLL插件里建了个基于对话框主面板CParsePanel,点击CParsePanel上一个按钮想让它弹出对话框void CParsePanel::OnButton() 
{
// TODO: Add your control notification handler code here
CLock lock;
m_ctlConfigPathName.GetWindowText(m_strConfigPathName);
CConfigModify dlg(this,m_strConfigPathName);
dlg.DoModal();
}CLock类如下
CLock::CLock()
{
m_hOldHandle=::AfxGetResourceHandle();
::AfxSetResourceHandle(theApp.m_hInstance);
}运行到DoModal时报错,dlgdata.cpp line:308
内容是ASSERT(::GetWindowLong(hWndCtrl, GWL_STYLE) & WS_GROUP);
我不明白什么意思,请高人指点另外,不加CLock时不报错,但不弹出对话框
我在以前一个插件里用与上面一模一样的代码,可以弹出对话框,不报错

解决方案 »

  1.   

    ASSERT(::GetWindowLong(hWndCtrl, GWL_STYLE) & WS_GROUP);
    从这一段,看不去必须设置WS_GROUP的属性.
    MSDN
    WS_GROUP 
    Specifies the first control of a group of controls. The group consists of this first control and all controls defined after it, up to the next control with the WS_GROUP style. The first control in each group usually has the WS_TABSTOP style so that the user can move from group to group. The user can subsequently change the keyboard focus from one control in the group to the next control in the group by using the direction keys.
    You can turn this style on and off to change dialog box navigation. To change this style after a window has been created, use SetWindowLong.
      

  2.   

    CConfigModify 初始化失败。你断点跟踪到初始化函数看那里出错了
      

  3.   

    好像发现原因了,我在CConfigModify对应的对话框里加了两个radio控件,但classwizard里没显示这个控件,于是我就直接在代码里关联变量,结果就报错但我不知道对话框上的radio为什么没有在classwizard中显示