Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old February 27th, 2007, 06:05 AM
fcvcnet
Guest
 
Posts: n/a
Default 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 ==========



  #2  
Old February 27th, 2007, 06:15 AM
Ian Collins
Guest
 
Posts: n/a
Default 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.
  #3  
Old February 27th, 2007, 06:35 AM
David Harmon
Guest
 
Posts: n/a
Default 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

  #4  
Old February 27th, 2007, 06:45 AM
fcvcnet
Guest
 
Posts: n/a
Default Re: faq how to solve this error

yes, I use vs2005 on windows xp.

Quote:
Quote:
> CSegment(void);
>
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.


  #5  
Old February 27th, 2007, 06:45 AM
fcvcnet
Guest
 
Posts: n/a
Default Re: faq how to solve this error

Ok, thanks you all.
Now I go to the windows group mfc.


  #6  
Old February 27th, 2007, 06:45 AM
kwikius
Guest
 
Posts: n/a
Default 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



  #7  
Old February 27th, 2007, 06:55 AM
Ian Collins
Guest
 
Posts: n/a
Default Re: faq how to solve this error

fcvcnet wrote:
Quote:
yes, I use vs2005 on windows xp.
>
>
>
Quote:
Quote:
>>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!
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.
  #8  
Old March 2nd, 2007, 12:25 AM
Peter
Guest
 
Posts: n/a
Default 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

  #9  
Old March 2nd, 2007, 12:35 AM
Ian Collins
Guest
 
Posts: n/a
Default 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.
  #10  
Old March 2nd, 2007, 03:45 AM
fcvcnet
Guest
 
Posts: n/a
Default 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
>
>
>
>

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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.
Post your question now . . .
It's fast and it's free

Popular Articles