faq how to solve this error

Discussion in 'C++' started by fcvcnet, Feb 27, 2007.

  1. fcvcnet

    fcvcnet Guest

    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 ==========
     
    fcvcnet, Feb 27, 2007
    #1
    1. Advertising

  2. fcvcnet

    Ian Collins Guest

    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.
     
    Ian Collins, Feb 27, 2007
    #2
    1. Advertising

  3. fcvcnet

    David Harmon Guest

    On Tue, 27 Feb 2007 13:49:22 +0800 in comp.lang.c++, "fcvcnet" <> wrote,
    >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
     
    David Harmon, Feb 27, 2007
    #3
  4. fcvcnet

    fcvcnet Guest

    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.
     
    fcvcnet, Feb 27, 2007
    #4
  5. fcvcnet

    fcvcnet Guest

    Ok, thanks you all.
    Now I go to the windows group mfc.
     
    fcvcnet, Feb 27, 2007
    #5
  6. fcvcnet

    kwikius Guest

    On 27 Feb, 05:49, "fcvcnet" <> wrote:


    <...>

    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
     
    kwikius, Feb 27, 2007
    #6
  7. fcvcnet

    Ian Collins Guest

    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.
     
    Ian Collins, Feb 27, 2007
    #7
  8. fcvcnet

    Peter Guest

    "Ian Collins" <> wrote in message
    news:...
    > Never write function(void) in C++.



    there is no reason not to do this
     
    Peter, Mar 2, 2007
    #8
  9. fcvcnet

    Ian Collins Guest

    Peter wrote:
    >
    > "Ian Collins" <> wrote in message
    > news:...
    >
    >> Never write function(void) in C++.

    >
    > there is no reason not to do this
    >

    Nor is there one to do it.

    --
    Ian Collins.
     
    Ian Collins, Mar 2, 2007
    #9
  10. fcvcnet

    fcvcnet Guest

    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" <>
    ??????:...
    > On 27 Feb, 05:49, "fcvcnet" <> wrote:
    >
    >
    > <...>
    >
    > 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
    >
    >
    >
    >
     
    fcvcnet, Mar 2, 2007
    #10
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ajith Nair
    Replies:
    0
    Views:
    1,646
    Ajith Nair
    Aug 17, 2005
  2. Miguel Dias Moura

    How do i solve this error?

    Miguel Dias Moura, Dec 9, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    1,873
  3. Erland
    Replies:
    1
    Views:
    400
    =?Utf-8?B?RGFsZQ==?=
    Apr 13, 2006
  4. bruce
    Replies:
    0
    Views:
    508
    bruce
    Jul 21, 2008
  5. bruce
    Replies:
    0
    Views:
    640
    bruce
    Jul 21, 2008
Loading...

Share This Page