473,395 Members | 1,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 ==========

Feb 27 '07 #1
9 4729
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
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
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
Ok, thanks you all.
Now I go to the windows group mfc.
Feb 27 '07 #5
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
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

"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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Koen | last post by:
Hi all, I created a little database to manage my e-books. The program will synchronize a table with the contents of a directory. Works great. Because I keep additional info (like keywords) to...
8
by: MyAlias | last post by:
Can't solve this CallBack returning structures Error message: An unhandled exception of type 'System.NullReferenceException' occurred in MyTest.exe Additional information: Object reference not...
1
by: arun | last post by:
Query is too complex -------------------------------------------------------------------------------- Hi, I was trying to solve this problem since last two days but couldn't find any solution. ...
2
by: katrinkerber | last post by:
Hello, I need help to solve a runtime error that keeps reocurring every time I try to convert an Excel file into an Acess File. I have looked through many forums trying to find help, but I have...
4
by: namalapavan | last post by:
hii , i am getting and error while installing oracle9i on RHEL AS 4.0 .i am sure that somebody here would be able to solve my problem.kindly reply so that i can send you the detailed error report....
17
by: Michael Reichenbach | last post by:
Here is the example code. int main(int argc, char *argv) { string Result; WIN32_FIND_DATA daten; HANDLE h = FindFirstFile(TEXT("c://test"), &daten); system("PAUSE"); return EXIT_SUCCESS; }
3
by: thalinx | last post by:
Hi can ayone help me with this program, cause i dont know how to solve the compiling errors here. thanks # include<stdlib.h> # include<conio.h> # include<stdio.h> # define MAXCADENA 8 # define...
7
by: akmaRudiliyn | last post by:
Hai everybody :). I have problem and need help. ERROR: ERROR Violation of PRIMARY KEY constraint 'PK_Table1_01'. Cannot insert duplicate key in object 'dbo.table1'. ERROR The statement has...
1
by: Ryan Liu | last post by:
Hi, I have a 100 clients/ one server application, use ugly one thread pre client approach. And both side user sync I/O. I frequently see the error on server side(client side code is same, but...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.