By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,581 Members | 2,023 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,581 IT Pros & Developers. It's quick & easy.

faq how to solve this error

P: n/a
Hi,
I write a class
class CSegment
{
public:
CSegment(void);
public:
~CSegment(void);
public:
CArray< CList< CPoint, CPoint& >, CList< CPoint, CPoint& >& m_curve;
CArray< int, int& m_superindex;
CArray< bool, bool& m_direction;

};

and in CmaxregionborderView I add a member variable
class CmaxregionborderView : public CView
{
....
public:
CmaxregionborderDoc* GetDocument() const;

public:
CArray< CList< CSegment, CSegment& >, CList< CSegment, CSegment& >& >
m_bordersegmentlist;
....
};

when compile I got error as list below ,how to solve these error? Thanks a
lot.

------ Build started: Project: maxregionborder, Configuration: Debug
Win32 ------
Compiling...
maxregionborder.cpp
d:\program files\microsoft visual studio 8\vc\atlmfc\include\afxtempl.h(272)
: error C2248: 'CObject::operator =' : cannot access private member declared
in class 'CObject'
d:\program files\microsoft visual studio
8\vc\atlmfc\include\afx.h(554) : see declaration of 'CObject::operator ='
d:\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<TYPE,ARG_TYPE>::opera tor =(const
CArray<TYPE,ARG_TYPE&)'
with
[
TYPE=CList<CPoint,CPoint &>,
ARG_TYPE=CList<CPoint,CPoint &&
]
d:\program files\microsoft visual studio 8\vc\atlmfc\include\afxtempl.h(272)
: error C2248: 'CObject::operator =' : cannot access private member declared
in class 'CObject'
d:\program files\microsoft visual studio
8\vc\atlmfc\include\afx.h(554) : see declaration of 'CObject::operator ='
d:\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<TYPE,ARG_TYPE>::opera tor =(const
CArray<TYPE,ARG_TYPE&)'
with
[
TYPE=int,
ARG_TYPE=int &
]
d:\program files\microsoft visual studio 8\vc\atlmfc\include\afxtempl.h(272)
: error C2248: 'CObject::operator =' : cannot access private member declared
in class 'CObject'
d:\program files\microsoft visual studio
8\vc\atlmfc\include\afx.h(554) : see declaration of 'CObject::operator ='
d:\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<TYPE,ARG_TYPE>::opera tor =(const
CArray<TYPE,ARG_TYPE&)'
with
[
TYPE=bool,
ARG_TYPE=bool &
]
maxregionborderView.cpp
d:\program files\microsoft visual studio 8\vc\atlmfc\include\afxtempl.h(272)
: error C2248: 'CObject::operator =' : cannot access private member declared
in class 'CObject'
d:\program files\microsoft visual studio
8\vc\atlmfc\include\afx.h(554) : see declaration of 'CObject::operator ='
d:\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<TYPE,ARG_TYPE>::opera tor =(const
CArray<TYPE,ARG_TYPE&)'
with
[
TYPE=CList<CPoint,CPoint &>,
ARG_TYPE=CList<CPoint,CPoint &&
]
d:\program files\microsoft visual studio 8\vc\atlmfc\include\afxtempl.h(272)
: error C2248: 'CObject::operator =' : cannot access private member declared
in class 'CObject'
d:\program files\microsoft visual studio
8\vc\atlmfc\include\afx.h(554) : see declaration of 'CObject::operator ='
d:\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<TYPE,ARG_TYPE>::opera tor =(const
CArray<TYPE,ARG_TYPE&)'
with
[
TYPE=int,
ARG_TYPE=int &
]
d:\program files\microsoft visual studio 8\vc\atlmfc\include\afxtempl.h(272)
: error C2248: 'CObject::operator =' : cannot access private member declared
in class 'CObject'
d:\program files\microsoft visual studio
8\vc\atlmfc\include\afx.h(554) : see declaration of 'CObject::operator ='
d:\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<TYPE,ARG_TYPE>::opera tor =(const
CArray<TYPE,ARG_TYPE&)'
with
[
TYPE=bool,
ARG_TYPE=bool &
]
Generating Code...
Build log was saved at
"file://e:\work\maxregionborder\maxregionborder\maxregionb order\Debug\BuildLog.htm"
maxregionborder - 6 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Feb 27 '07 #1
Share this Question
Share on Google+
9 Replies


P: n/a
fcvcnet wrote:
Hi,
I write a class
class CSegment
{
public:
CSegment(void);
Never write function(void) in C++.
public:
~CSegment(void);
public:
CArray< CList< CPoint, CPoint& >, CList< CPoint, CPoint& >& m_curve;
This looks horribly like widows code, so you'd better post to windows
development group

--
Ian Collins.
Feb 27 '07 #2

P: n/a
On Tue, 27 Feb 2007 13:49:22 +0800 in comp.lang.c++, "fcvcnet" <fc*****@163.comwrote,
>d:\program files\microsoft visual studio 8\vc\atlmfc\include\afxtempl.h(272)
: error C2248: 'CObject::operator =' : cannot access private member declared
in class 'CObject'
Your error is happening in a Microsoft header file, in a Microsoft-specific class.

See the welcome message posted twice per week in comp.lang.c++ under the subject "Welcome to comp.lang.c++! Read this first." or available at
http://www.slack.net/~shiva/welcome.txt

Feb 27 '07 #3

P: n/a
yes, I use vs2005 on windows xp.

> CSegment(void);

Never write function(void) in C++.
I use class wizard in vs2005 to write this class. The code is generate by
vs2005.

This looks horribly like widows code, so you'd better post to windows
development group
Yes , it is windows code, but I think it have some relation with c++ .
Do I have to ask in widows group?
what ever thanks you Ian Collins.
Feb 27 '07 #4

P: n/a
Ok, thanks you all.
Now I go to the windows group mfc.
Feb 27 '07 #5

P: n/a
On 27 Feb, 05:49, "fcvcnet" <fcvc...@163.comwrote:
<...>

Hint,

Try looking up CObject in the VC8 docs. This error is covered there.

"Compiler Errors when Implementing a CObject-Derived Class "

regards
Andy Little

Feb 27 '07 #6

P: n/a
fcvcnet wrote:
yes, I use vs2005 on windows xp.
>>CSegment(void);

Never write function(void) in C++.

I use class wizard in vs2005 to write this class. The code is generate by
vs2005.
I didn't realise it was that bad!
>>This looks horribly like widows code, so you'd better post to windows
development group

Yes , it is windows code, but I think it have some relation with c++ .
Do I have to ask in widows group?
Yes, the problem is somewhere in the bowels of a windows header.

--
Ian Collins.
Feb 27 '07 #7

P: n/a

"Ian Collins" <ia******@hotmail.comwrote in message
news:54*************@mid.individual.net...
Never write function(void) in C++.

there is no reason not to do this

Mar 2 '07 #8

P: n/a
Peter wrote:
>
"Ian Collins" <ia******@hotmail.comwrote in message
news:54*************@mid.individual.net...
>Never write function(void) in C++.

there is no reason not to do this
Nor is there one to do it.

--
Ian Collins.
Mar 2 '07 #9

P: n/a
Thank you . I have see it.
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_vccomp/html/9f249b52-aeff-41a1-8a74-a52aa08c4fcf.htm

"kwikius" <an**@servocomm.freeserve.co.uk>
??????:11*********************@s48g2000cws.googleg roups.com...
On 27 Feb, 05:49, "fcvcnet" <fcvc...@163.comwrote:
<...>

Hint,

Try looking up CObject in the VC8 docs. This error is covered there.

"Compiler Errors when Implementing a CObject-Derived Class "

regards
Andy Little


Mar 2 '07 #10

This discussion thread is closed

Replies have been disabled for this discussion.