现在的问题是,我在列表框中把一个文件夹的文件全都显示出来了,现在想选择一个文件把它删掉.
想用 for (int i=m_list.GetCount()-1;i>-1;i--)
{
if(m_list.GetSel(i))
{
m_file=m_list.GetCaretIndex(i);
// m_list.DeleteString(i);
DeleteFile(m_file);
}
}
GetCaretIndex是得到选择文件的路径,在用deletefile把它删掉,可是编译时提示error C2660: 'GetCaretIndex' : function does not take 1 parameters.请问我错在哪里??
想用 for (int i=m_list.GetCount()-1;i>-1;i--)
{
if(m_list.GetSel(i))
{
m_file=m_list.GetCaretIndex(i);
// m_list.DeleteString(i);
DeleteFile(m_file);
}
}
GetCaretIndex是得到选择文件的路径,在用deletefile把它删掉,可是编译时提示error C2660: 'GetCaretIndex' : function does not take 1 parameters.请问我错在哪里??
CListBox::GetCaretIndex
int GetCaretIndex( ) const;Return ValueThe zero-based index of the item that has the focus rectangle in a list box. If the list box is a single-selection list box, the return value is the index of the item that is selected, if any.ResAn application calls the GetCaretIndex member function to determine the index of the item that has the focus rectangle in a multiple-selection list box. The item may or may not be selected.
可以根据索引,得到文本,我想这个文本就是文件名吧.