CListBox::GetText(用该函数获得内容)
////////////////////////////////////////
CString number;
m_listbox.GetText(x,name);//x为索引
int i;
i = atoi(number);

解决方案 »

  1.   

    根本不存在CListBox::GetText()这个函数,有其他的方法吗?
      

  2.   

    UINT GetDlgItemInt(
      HWND hDlg,           // handle to dialog box
      int nIDDlgItem,      // control identifier
      BOOL *lpTranslated,  // success state
      BOOL bSigned         // signed or unsigned value
    );
      

  3.   

    extern CListBox* pmyListBox;// Dump all of the items in the list box.
    #ifdef _DEBUG
       CString str, str2;
       int n;
       for (int i=0;i < pmyListBox->GetCount();i++)
       {
          n = pmyListBox->GetTextLen( i );
          pmyListBox->GetText( i, str.GetBuffer(n) );
          str.ReleaseBuffer();      str2.Format(_T("item %d: %s\r\n"), i, str.GetBuffer(0));
          afxDump << str2;
       }
    #endif