AREASTOREINFO_t& oneItemTemp =  info.GetAt( i ).GetAt( k );
for ( int n = 1; n < asInfo.GetAt( nPos ).GetSize(); n++ )
{
AREASTOREINFO_t one;
one = asInfo.GetAt( nPos ).GetAt( n );
if ( one.csCode > oneItemTemp.csCode )
{
   continue;
}
         else if ( one.csCode == oneItemTemp.csCode )
{
   break;
}
else
{
   asInfo.GetAt( nPos ).InsertAt( n, oneItemTemp, 1 );
   break;
}
}
f:\program files\microsoft visual studio 8\vc\atlmfc\include\afxtempl.h(272) : error C2248: 'CObject::CObject' : cannot access private member declared in class 'CObject'
        f:\program files\microsoft visual studio 8\vc\atlmfc\include\afx.h(553) : see declaration of 'CObject::CObject'
        f:\program files\microsoft visual studio 8\vc\atlmfc\include\afx.h(524) : see declaration of 'CObject'
        This diagnostic occurred in the compiler generated function 'CArray<TYPE,ARG_TYPE>::CArray(const CArray<TYPE,ARG_TYPE> &)'
        with
        [
            TYPE=arrColumn,
            ARG_TYPE=CustomArray<AREASTOREINFO_t,AREASTOREINFO_t &> 
        ]

解决方案 »

  1.   

    cannot access private member declared in class 'CObject',我看到这个了,但是CObject也不是我能改的啊。
      

  2.   

    不是要你改CObject类,改自己的代码,为什么直接调用私有成员呢?COject没有提供get或set函数吗?
      

  3.   

    解决了,是这样的,我的这段代码是从一个函数里考出来的,函数是这样定义的
    arrASInfo DBAccesser::SortASInfo(arrASInfo &info)
    把返回类型改成void就好了,
    arrASInfo是我自己定义的,也没有定义成私有啊,还是不明白是怎么回事