MFC listbox

How do I add a item to a list Box

here is my code that opens a fileopen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
CFileDialog mp3(TRUE,NULL,NULL,OFN_HIDEREADONLY,"MP3 Files (*.mp3)|*.mp3|");
  



if(mp3.DoModal() == IDOK)
		{
			m_Path = mp3.GetPathName();
			UpdateData(FALSE);
		
		}

m_Video = MCIWndCreate(this->GetSafeHwnd(),
			AfxGetInstanceHandle(),
			MCIWNDF_NOMENU,m_Path); // for mp3 player part


when i try to use this code
 
SendDlgItemMessage(IDC_LIST1, LB_ADDSTRING, 0,m_Path);

it gives me this error

************************MP3 PLAYERDlg.cpp(115) : error C2664: 'SendDlgItemMessageA' : cannot convert parameter 4 from 'class CString' to 'long'



oh yeah...i delcared m_Path as a CString in header file
Last edited on
Just use AddString() method of CListBox MFC class.
http://msdn.microsoft.com/en-US/library/2cekde96(v=vs.100).aspx
Topic archived. No new replies allowed.