GetDlgItemInt()是四舍五入的,如何读出小数(不四舍五入)

解决方案 »

  1.   

    CString s = GetDlgItem(ID_EDIT1)->GetWindowText();float f = atof(s);
      

  2.   

    GetDlgItemText 读入整个字符串,再用其他函数转换
      

  3.   

    float f = atof(s.GetBuffer(s.GetLength()));
      

  4.   

    我用控件变量,类型double,行不?程序出现access violation,怎么回事?
      

  5.   

    to:Avoid(千金散尽还复来) 
    出现断言错误(afx.inl)
      

  6.   

    edit里获得字符串后 用atof转掉就可以了。
      

  7.   

    骗帖干什么,没那工夫.忘了结了.这次完了一起结,呵呵.
    double 转CString 怎么操做,谢谢!!菜鸟
      

  8.   

    CString str;
    str.Format("%f",my_doubleValue);
      

  9.   

    float f = atof( GetDlgItem(ID_EDIT)->GetWindowText().GetBuffer(0));