
February 27th, 2007, 06:05 AM
| | | faq how to solve this error
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 ========== | 
February 27th, 2007, 06:15 AM
| | | Re: faq how to solve this error
fcvcnet wrote: Quote:
Hi,
I write a class
class CSegment
{
public:
CSegment(void);
| Never write function(void) in C++. Quote:
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. | 
February 27th, 2007, 06:35 AM
| | | Re: faq how to solve this error
On Tue, 27 Feb 2007 13:49:22 +0800 in comp.lang.c++, "fcvcnet" <fcvcnet@163.comwrote, Quote:
>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 | 
February 27th, 2007, 06:45 AM
| | | Re: faq how to solve this error
yes, I use vs2005 on windows xp. Quote: >
Never write function(void) in C++.
>
| I use class wizard in vs2005 to write this class. The code is generate by
vs2005. Quote:
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. | 
February 27th, 2007, 06:45 AM
| | | Re: faq how to solve this error
Ok, thanks you all.
Now I go to the windows group mfc. | 
February 27th, 2007, 06:45 AM
| | | Re: faq how to solve this error
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 | 
February 27th, 2007, 06:55 AM
| | | Re: faq how to solve this error
fcvcnet wrote: Quote:
yes, I use vs2005 on windows xp.
>
>
> Quote: >>
>>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! Quote: Quote:
>>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. | 
March 2nd, 2007, 12:25 AM
| | | Re: faq how to solve this error
"Ian Collins" <ian-news@hotmail.comwrote in message
news:54i01kF206t9jU8@mid.individual.net... Quote: |
Never write function(void) in C++.
|
there is no reason not to do this | 
March 2nd, 2007, 12:35 AM
| | | Re: faq how to solve this error
Peter wrote: Quote:
>
"Ian Collins" <ian-news@hotmail.comwrote in message
news:54i01kF206t9jU8@mid.individual.net...
> Quote: |
>Never write function(void) in C++.
| >
there is no reason not to do this
>
| Nor is there one to do it.
--
Ian Collins. | 
March 2nd, 2007, 03:45 AM
| | | Re: faq how to solve this error
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" <andy@servocomm.freeserve.co.uk>
??????:1172558304.643132.30580@s48g2000cws.googleg roups.com... Quote:
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
>
>
>
>
| |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | | | What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over network members.
|