faq how to solve this error

F

fcvcnet

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::eek:perator =' : 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::eek:perator ='
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>::eek:perator =(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::eek:perator =' : 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::eek:perator ='
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>::eek:perator =(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::eek:perator =' : 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::eek:perator ='
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>::eek:perator =(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::eek:perator =' : 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::eek:perator ='
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>::eek:perator =(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::eek:perator =' : 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::eek:perator ='
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>::eek:perator =(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::eek:perator =' : 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::eek:perator ='
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>::eek:perator =(const
CArray<TYPE,ARG_TYPE> &)'
with
[
TYPE=bool,
ARG_TYPE=bool &
]
Generating Code...
Build log was saved at
"file://e:\work\maxregionborder\maxregionborder\maxregionborder\Debug\BuildLog.htm"
maxregionborder - 6 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
 
I

Ian Collins

fcvcnet said:
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
 
D

David Harmon

d:\program files\microsoft visual studio 8\vc\atlmfc\include\afxtempl.h(272)
: error C2248: 'CObject::eek:perator =' : 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
 
F

fcvcnet

yes, I use vs2005 on windows xp.

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.
 
K

kwikius

<...>

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
 
I

Ian Collins

fcvcnet said:
yes, I use vs2005 on windows xp.




I use class wizard in vs2005 to write this class. The code is generate by
vs2005.

I didn't realise it was that bad!
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.
 
F

fcvcnet

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,173
Latest member
GeraldReund
Top