【发布时间】:2012-04-15 19:29:02
【问题描述】:
我遇到了问题。我有一个项目“MicroSIP”,用于 基于 SIP 的基于 IP 的呼叫语音。我正在将它运行到 VS 2010 中,我需要 根据我的需要定制它。为此,我一编辑 主对话框(拨号器)并添加一些其他控件(如编辑控件 CEdit) 并从“添加变量”向导中添加成员变量, 它显示消息“无法更新 DoDataExchange 方法”。 如果在 程序,它有 NULL 指针或未定义的引用。
它现在在DDX_Control(pDX, IDC_EDIT_Address, MacAddressEditCtrl ); 内部崩溃,其中IDC_EDIT_Address 是id,MAcAddressEditctrl 是CWnd 对象。
void AFXAPI DDX_Control(CDataExchange* pDX, int nIDC, CWnd& rControl)
{
if ((rControl.m_hWnd == NULL) && (rControl.GetControlUnknown() == NULL)) // not subclassed yet
{
ASSERT(!pDX->m_bSaveAndValidate);
pDX->PrepareCtrl(nIDC); //it crashes here...
HWND hWndCtrl;
pDX->m_pDlgWnd->GetDlgItem(nIDC, &hWndCtrl);
if ((hWndCtrl != NULL) && !rControl.SubclassWindow(hWndCtrl))
{
ASSERT(FALSE); // possibly trying to subclass twice?
AfxThrowNotSupportedException();
}
#ifndef _AFX_NO_OCC_SUPPORT
else
{
if (hWndCtrl == NULL)
{
if (pDX->m_pDlgWnd->GetOleControlSite(nIDC) != NULL)
{
rControl.AttachControlSite(pDX->m_pDlgWnd, nIDC);
}
}
else
{
// If the control has reparented itself (e.g., invisible control),
// make sure that the CWnd gets properly wired to its control site.
if (pDX->m_pDlgWnd->m_hWnd != ::GetParent(rControl.m_hWnd))
rControl.AttachControlSite(pDX->m_pDlgWnd);
}
}
#endif //!_AFX_NO_OCC_SUPPORT
}
}
【问题讨论】:
标签: c++ visual-studio-2010 visual-studio-2008 visual-c++ mfc