VC++中列表控件CListCtrl, 设置双击响应函数,通过m_ListCtrl.GetItemText()可获得双击时的文件名,通过文件名怎么获得此文件的路径呢?   
  请大虾帮忙!!!请大虾说的具体点!!1

解决方案 »

  1.   

    路径 不就是 你系统运行的路径吗 用getsystempath来获取
      

  2.   

    void CAPdu::OnDblclkList1(NMHDR* pNMHDR, LRESULT* pResult) 
    {
    // TODO: Add your control notification handler code here
    if( m_brunning )
    {
    m_brunning = 0;
    return;
    }
    POSITION pos;
    pos = m_list1.GetFirstSelectedItemPosition();
    if( pos )
    {
    char t[ 1000 ] = "";
    int i = m_list1.GetNextSelectedItem( pos );
    m_list1.GetItemText( i, APDU_HEAD, t, 1000 );
    t[ 10 ] = 0x20;
    m_list1.GetItemText( i, APDU_SEND, t + 11, 990 );
    m_edit1.SetSel( -1, -1 );
    m_edit1.ReplaceSel( t );
    m_edit1.ReplaceSel( g____crlf );
    }
    *pResult = 0;
    }一个例子