我有问题。我有一个项目“MicroSIP”,用于基于 SIP 的 IP 呼叫语音。我将它运行到 VS 2010 中,我需要根据我的需要对其进行自定义。为此,只要我编辑主对话框( Dialer )并添加一些其他控件(例如 CEdit 的编辑控件)并从“添加变量”向导添加成员变量,它就会显示消息“无法更新 DoDataExchange 方法”。此外,如果在程序中获取新放置的“编辑控件”的引用,它有空指针或未定义的引用。
它现在在DDX_Control(pDX, IDC_EDIT_Address, MacAddressEditCtrl );
where和IDC_EDIT_Address
is对象内崩溃。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
}
}