请各位看看这条:
CString sPad(_T(''),2+3*(m_nBytesPerLine-nRet));
m_nBytesPerLine 和nRet都是int.
为什么提示
empty character constant
term does not evaluate to a functoin

解决方案 »

  1.   

    CString sPad(_T(""),2+3*(m_nBytesPerLine-nRet));
      

  2.   

    (_T("")如果里面是双引号肯定ok
      

  3.   

    看看CString的构造函数的定义!
    要不初始化时添加内容"_t("hello!")"
      

  4.   

    CString sPad(_T(" "),2+3*(m_nBytesPerLine-nRet));
                    ^^^
                    要有空格
      

  5.   

    你的问题在于空串,我想你可能要空格,我的这段代码是好用的。
    CString tmp(' ',3*2-1);
      

  6.   

    rokia(rokia) 
    的问题在于
    "" 和 ''
    CString 只可以用字符来repeat
    如果用的是串的话后面是要出始的长度
      

  7.   

    我知道了,我调用了FORMAT
    CString sPad.Format(_T(''),2+3*(m_nBytesPerLine-nRet));
    多谢各位.
      

  8.   

    我用以下的代码试过没有问题啊:
    int i = 6;
    int j = 5;
    CString str(_T(""),2+3*(i-j));你可以再定义两个变量暂代m_nBytesPerLine, nRet试试,我怀疑是不是这两个变量有问题。