search

Home  >  Q&A  >  body text

c++ - 关于在vs2013中写MFC出现的错误的修改

无法用 "double" 类型的值初始化 "CWnd &" 类型的引用(非常量限定)

上图是出错的显示

void CDemoDlg::DoDataExchange(CDataExchange* pDX)
{
    CDialogEx::DoDataExchange(pDX);
    DDX_Control(pDX, IDC_Add1, m_add1);
    DDX_Control(pDX, IDC_Add2, m_add2);
    DDX_Control(pDX, IDC_Result, m_result);
    DDX_Control(pDX, IDC_Algorithm, m_algorithm);
    DDX_Control(pDX, IDC_Use, m_use);
    DDX_Control(pDX, IDC_Plus, m_plus);
}

出错的m_add1,m_add2,m_result,m_use,m_plus;

public:
    afx_msg void OnClose();
    double m_add1;
    double m_add2;
    double m_result;
    CStatic m_algorithm;
    BOOL m_use;
    int m_plus;

没法插入所以就贴出来

迷茫迷茫2808 days ago564

reply all(1)I'll reply

  • 迷茫

    迷茫2017-04-17 13:48:03

    It seems that the parameter type does not match

    reply
    0
  • Cancelreply