win8 vs2005
在看了很多例子無果之後終於找到解決方法
m_list是ListControl的控件變量
DWORD dwStyle=::GetWindowLong(m_list.m_hWnd,GWL_STYLE);
//設置爲報表形式
SetWindowLong(m_list.m_hWnd,GWL_STYLE,dwStyle|LVS_REPORT);
DWORD ExStyle =m_list.GetExtendedStyle();
//設置爲整欄選擇和網格線
m_list.SetExtendedStyle(ExStyle|LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES);
=================================================================================================
//#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // 某些 CString 構造函數將是顯式的
註釋掉 可以規避下面的這個錯誤
“初始化”: 無法從“BSTR”轉換爲“ATL::CStringT<BaseType,StringTraits>”