error C2280: “CMap<CString,LPCWSTR,CString,LPCWSTR>::CMap(const CMap<CString,LPCWSTR,CString,LPCWSTR> &)”: 尝试引用已删除的函数
//问题点:
typedef CMap<CString, LPCWSTR, CString, LPCWSTR> OHMapFieldAndValue;
int executeSelect(CString strTable, OHMapFieldAndValue fieldAndValue, OHDataTable* dataTable);
OHMapFieldAndValue map;
map.SetAt(_T(“A1”), _T(“a”));
map.SetAt(_T(“A2”), _T(“s”));
oci.executeSelect(_T(“tab_test”), map, &res);
//编译后报错:
error C2280: “CMap<CString,LPCWSTR,CString,LPCWSTR>::CMap(const CMap<CString,LPCWSTR,CString,LPCWSTR> &)”: 尝试引用已删除的函数
//解决办法:
int executeSelect(CString strTable, OHMapFieldAndValue fieldAndValue, OHDataTable* dataTable);
改成
int executeSelect(CString strTable, OHMapFieldAndValue& fieldAndValue, OHDataTable* dataTable);