void CMFCConnectSqlDlg::OnRclickLISTData(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
CMFCConnectSqlDlg CSqlDlga;
int nSelRows = CSqlDlga.m_List_Value.GetSelectedCount();
if(!nSelRows)
return ;
POSITION pos = CSqlDlga.m_List_Value.GetFirstSelectedItemPosition();
int n=CSqlDlga.m_List_Value.GetNextSelectedItem(pos);
//wchar_t m_ID[30]={0};
theApp.M_ID=_ttoi(CSqlDlga.m_List_Value.GetItemText(n,0));//CString轉化為int
int m_currentitem = CSqlDlga.m_List_Value.GetNextItem(-1,LVNI_SELECTED|LVNI_FOCUSED);
theApp.M_ID=_ttoi(CSqlDlga.m_List_Value.GetItemText(m_currentitem,0));
運行到GetSelectedCount()
彈出提示:Debug Assertion failed!
各位大蝦救命啊
你不應該重新構造一個對象,而是用當前對象
int nSelRows = this->m_List_Value.GetSelectedCount();