【问题标题】:Unable to update DoDataExchange method : VS 2000 Project converted to Visual Studio 2008 or VS 2010 Options无法更新 DoDataExchange 方法:VS 2000 项目转换为 Visual Studio 2008 或 VS 2010 选项
【发布时间】:2012-04-15 19:29:02
【问题描述】:

我遇到了问题。我有一个项目“MicroSIP”,用于 基于 SIP 的基于 IP 的呼叫语音。我正在将它运行到 VS 2010 中,我需要 根据我的需要定制它。为此,我一编辑 主对话框(拨号器)并添加一些其他控件(如编辑控件 CEdit) 并从“添加变量”向导中添加成员变量, 它显示消息“无法更新 DoDataExchange 方法”。 如果在 程序,它有 NULL 指针或未定义的引用。

它现在在DDX_Control(pDX, IDC_EDIT_Address, MacAddressEditCtrl ); 内部崩溃,其中IDC_EDIT_AddressidMAcAddressEditctrlCWnd 对象。

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


    【解决方案1】:

    我意识到我自己放置并编写了另一个 OnInitDialog 的代码.. 这是主对话框对整个我试图操纵另一个对话框的代码的控制。 谢谢

    【讨论】:

      猜你喜欢
      • 2012-08-22
      • 1970-01-01
      • 1970-01-01
      • 2011-06-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多