编译老是出错说不可以访问私有成员microsoft visual studio 9.0\vc\atlmfc\include\afxtempl.h(776) : error C2248: 'CObject::CObject' : cannot access private member declared in class 'CObject'void SetPathList(CString path,CList<CString,CString&> pathlist,int current);
这个函数应该怎么申明好

解决方案 »

  1.   

    申明没有问题,是不是你函数里对pathlist的赋值之类的操作有问题
      

  2.   

    ls的,函数体是空的,啥也没做,编译都要出报错啊
    我的是mfc 程序
      

  3.   

    我晕倒啊,函数定义没有问题,是使用有问题
    这里这个m_pathList是  执行这个函数的class成员变量 CList<CString,CString&>   m_pathlist; 
    setpathList(L"",m_pathlist,10);
      

  4.   

    改为这样试下。。void SetPathList(CString path,CList<CString,CString&>& pathlist,int current);