printf("%4d,%12s,%12f,%12x\n",int,lexeme,value,toke)翻译成listbox,怎么写?int 是int型的,要多列显示,((CListBox*)GetDlgItem(IDC_LIST1))->AddString(token.lexeme);只能显示一列一列的显示,一行不能显示多列,要怎么写啊???

解决方案 »

  1.   

    你可以用CListCtrl替换CListBox,也就是用列表控件
      

  2.   

    可以:
    CString str.printf("%4d,%12s,%12f,%12x\n",int,lexeme,value,toke);
    ((CListBox*)GetDlgItem(IDC_LIST1))->AddString(str);
      

  3.   

    CString str.format("%4d,%12s,%12f,%12x\n",int,lexeme,value,toke);
    ((CListBox*)GetDlgItem(IDC_LIST1))->AddString(str);
      

  4.   

    还是不行啊。提示:error C2143: syntax error : missing ';' before '.'错误。。
    CString str.format("%4d,%12s,%12f,%12x\n",int,lexeme,value,toke);这个到底要怎样写啊。。
      

  5.   

    CString str;
    str.format("%4d,%12s,%12f,%12x\n",int,lexeme,value,toke);
      

  6.   

    CString str;
    str.format("%4d,%12s,%12f,%12x",int,lexeme,value,toke);
    嗯,这是可以的。。但是里面不能有\n。。感谢了。。