Click here to Skip to main content
15,891,184 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to Enable the menu item Pin
SandipG 13-Jun-07 18:38
SandipG 13-Jun-07 18:38 
AnswerRe: How to Enable the menu item Pin
Hamid_RT13-Jun-07 19:28
Hamid_RT13-Jun-07 19:28 
QuestionTrying to delete a pointer to a template class with only its memory address Pin
Cyrilix13-Jun-07 16:51
Cyrilix13-Jun-07 16:51 
Questionneed help Pin
gentleguy13-Jun-07 16:49
gentleguy13-Jun-07 16:49 
AnswerRe: need help Pin
Garth J Lancaster13-Jun-07 16:58
professionalGarth J Lancaster13-Jun-07 16:58 
AnswerRe: need help Pin
Hamid_RT13-Jun-07 19:24
Hamid_RT13-Jun-07 19:24 
QuestionIntercept Outgoing Port 80 Pin
zx2c413-Jun-07 11:02
zx2c413-Jun-07 11:02 
QuestionError C2558 Pin
David Crow13-Jun-07 10:29
David Crow13-Jun-07 10:29 
Given the following two classes:

class A  
{
public:
    A() {}
    A( const A &si )
    {
        m_strName   = si.m_strName;
        m_strStatus = si.m_strStatus;
    }

    A( const A *si )
    {
        m_strName   = si->m_strName;
        m_strStatus = si->m_strStatus;
    }
     
    A( LPCTSTR lpszName, LPCTSTR lpszStatus )
        : m_strName(lpszName), m_strStatus(lpszStatus)
    {
    }
 
    virtual ~A() {}
 
private:
    CString m_strName;
    CString m_strStatus;
};
 
typedef CArray<A*, A*> arr;
 
//====================================================================
 
class B
{
public:
    B() {}
    B( const B &mi )
    {
        m_arrServices.Append(mi.m_arrServices);
    }
 	
    virtual ~B() {}
     
    arr GetServices( void ) const
    {
        return m_arrServices; // error C2558: class 'CArray<class A *,class A *>' : no copy constructor available
    }
 
private:
    arr m_arrServices;
};
I can't seem to figure out exactly what the compiler is complaining about (other than the obvious). I've changed the typedef statement to store actual objects, and references to an A object, all to no avail. I've had different types of constructors for A, but none of them seem to make a difference. The B::GetServices() method is supposed to return a copy of the m_arrServices array. I don't want to return a reference or a pointer to that array because I don't want it changed.

Both classes have several private members that I'm trying to provide getter and setter methods for. Any ideas?

Thanks,
DC


"A good athlete is the result of a good and worthy opponent." - David Crow

"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne


GeneralRe: Error C2558 Pin
Matthew Faithfull13-Jun-07 12:12
Matthew Faithfull13-Jun-07 12:12 
AnswerRe: Error C2558 Pin
Michael Dunn13-Jun-07 14:36
sitebuilderMichael Dunn13-Jun-07 14:36 
AnswerRe: Error C2558 Pin
Sameerkumar Namdeo13-Jun-07 18:15
Sameerkumar Namdeo13-Jun-07 18:15 
QuestionRadio Buttons Pin
l_d13-Jun-07 10:00
l_d13-Jun-07 10:00 
AnswerRe: Radio Buttons Pin
David Crow13-Jun-07 10:17
David Crow13-Jun-07 10:17 
AnswerRe: Radio Buttons Pin
_anil_13-Jun-07 15:27
_anil_13-Jun-07 15:27 
GeneralRe: Radio Buttons Pin
Akt_4_U13-Jun-07 22:53
Akt_4_U13-Jun-07 22:53 
QuestionWhat is C#? Pin
suchon_phuong13-Jun-07 7:09
suchon_phuong13-Jun-07 7:09 
AnswerRe: What is C#? Pin
David Crow13-Jun-07 7:24
David Crow13-Jun-07 7:24 
AnswerDon't answer this person. Pin
leckey13-Jun-07 7:58
leckey13-Jun-07 7:58 
AnswerRe: What is C#? Pin
Hamid_RT13-Jun-07 8:54
Hamid_RT13-Jun-07 8:54 
Questionsending data Pin
barbara_j_jenson13-Jun-07 6:38
barbara_j_jenson13-Jun-07 6:38 
AnswerRe: sending data Pin
Mark Salsbery13-Jun-07 7:03
Mark Salsbery13-Jun-07 7:03 
GeneralRe: sending data Pin
barbara_j_jenson14-Jun-07 1:29
barbara_j_jenson14-Jun-07 1:29 
Questionembedded resource in DLL v/s static library Pin
act_x13-Jun-07 6:20
act_x13-Jun-07 6:20 
AnswerRe: embedded resource in DLL v/s static library Pin
David Crow13-Jun-07 6:31
David Crow13-Jun-07 6:31 
QuestionCString concatenation problem Pin
penny black13-Jun-07 6:12
penny black13-Jun-07 6:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.