CListCtrl导出数据到Excel

//关于标题的获取,其他方法有可能只能获取可见的标题栏

//该方法可以获取所有标题栏

//获得列表EXCEL 
 void PublicMember::WxpVR_GetExcel(CListCtrl * wxpDataList)
{
	  
      WxpVR_vitemTitle.swap(vector<CString>());

	  AfxMessageBox("开始导出数据到Excel");

	  LVCOLUMN lvcol;
      char  str[256];
      int   nColNum;
      CString  strColumnName;

      nColNum = 0;
      lvcol.mask = LVCF_TEXT;
      lvcol.pszText = str;
      lvcol.cchTextMax = 256;
      while(wxpDataList->GetColumn(nColNum, &lvcol))
      { 
	       strColumnName.Format("%s",lvcol.pszText);
           nColNum++;
		   WxpVR_vitemTitle.push_back(strColumnName);
      }
	 
}

猜你喜欢

转载自blog.csdn.net/sichuanpb/article/details/84260537