我想用两个EIDT控件显示数据 对两个变量m_x m_y都设成CString型
m_x.Format("%f",x);
m_y.Format("%f",y);
编译结果总出现这种错误  是什么原因啊   大哥大姐们帮忙看看
error C2065: 'm_x' : undeclared identifier
error C2228: left of '.Format' must have class/struct/union type
error C2065: 'm_y' : undeclared identifier
error C2228: left of '.Format' must have class/struct/union type

解决方案 »

  1.   

    是不是在类向导里关联的CString类型。
      

  2.   

    m_x,m_y在定义在哪里?如果你写在类的.h中了,那么请把用到m_x,m_y的函数写成该类的成员函数.
      

  3.   

    点击相应得控件 ctrl+w--->member variables在control ids里面找到你要绑定得控件ID。加入CSTRING变量。
      

  4.   

    你没有导入CString的头文件吧?
      

  5.   

    你没有导入CString的头文件吧?
      

  6.   


    #include <afx.h>要是MFC程序就不用加的。
      

  7.   

    好的  马上去结贴  诸位的方法我都试过了  这是在MFC程序里而且貌似关联也没有问题  
    例外为什么我用UpdateData(TRUE)也会提示UpdateData:undeclared identifier的错误
      

  8.   

    贴代码吧,整个出错CPP文件代码都贴出来。
      

  9.   

    在CSDN社区中心,点击左边栏中的社区积分便可看到