class CStringMatrix
{
protected:
CArray m_stringMatrix;
public:
CStringMatrix(void);
~CStringMatrix(void);
const CString & GetAt(UINT nRow, UINT nCol);
void SetAt(const CString& szCell, UINT nRow, UINT nCol);
void AddRow(UINT nRow, CStringArray & stringRow);
};
//注释一行报错
void CStringMatrix::SetAt(const CString& szCell, UINT nRow, UINT nCol)
{
CStringArray &stringRow = m_stringMatrix.GetAt(nRow);
stringRow.SetAtGrow(nCol,szCell);
//m_stringMatrix.SetAtGrow(nRow, stringRow);
}
//报错信息如下
1>d:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxcoll.h(590) : error C2248: “CObject::operator =”: 无法访问 private 成员(在“CObject”类中声明)
1> d:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afx.h(562) : 参见“CObject::operator =”的声明
1> d:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afx.h(532) : 参见“CObject”的声明
此诊断出现在编译器生成的函数“CStringArray &CStringArray::operator =(const CStringArray &)”中