把一个页面的内容存入到一CSTRING类的二维数组中,想把它显示在同一文本编辑框中,定义的数组为14x24,且文本框也为14行,24列,然而直接用SetWindowText(menu)编译出错,显示error C2664: 'SetWindowTextA' : cannot convert parameter 1 from 'class CString [14][24]' to 'const char *',请高手指点,十分感谢。

解决方案 »

  1.   

    cannot convert parameter 1 from 'class CString [14][24]' to 'const char *',
    只能是字符串数组
    你要拍显示多行,需要自己用换行符分割字符串
    不能直接将二维数组当作参数进行设置的
      

  2.   

    CString str[14][24];
    ...
    ...
    CString strText(_T(""));
    for(int i=0; i<sizeof(str)/sizeof(str[0]); i++)
    {
     for(int j=0; j<sizeof(str[0])/sizeof(str[0][0]); j++)
     {
       strText += str[i][j];
       strText += _T("\r\n");
     }
    }
    SetDlgItemText(IDC_EDIT1, strTet);