CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 18

Threaded View

  1. #1
    Join Date
    May 2006
    Posts
    172

    Problem with CArray inside a structure

    Hi all,
    I have a Structure defined as follows

    Code:
    struct StationGroup 
      {
          CString cStrGroupName;
    	  
          CArray<CString,CString&> cArryStationList;
      };
    Which consist of a CArray of CString, Now i need to make a CArray of the structur, which i did as follows

    Code:
    CArray<StationGroup,StationGroup&> m_cArryGroupList;
    when i am adding a single object of the structure "StationGroup" to the CArray "m_cArryGroupList" as follows

    Code:
    m_cArryGroupList.Add((StationGroup&)sTructStationGroup);
    I get an error as follows and it no way indicates that the error is in the above line, but if i comment this line, Then i dont get the following error

    Code:
    PIConfigComm.cpp
    c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxtempl.h(272) : error C2248: 'CObject::operator =' : cannot access private member declared in class 'CObject'
            c:\program files\microsoft visual studio 8\vc\atlmfc\include\afx.h(554) : see declaration of 'CObject::operator ='
            c:\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>::operator =(const CArray<TYPE,ARG_TYPE> &)'
            with
            [
                TYPE=CString,
                ARG_TYPE=CString &
            ]
    where CPIConfigComm is the name of the class

    Can some one please help me....

    Thanks and Regards
    RK
    Last edited by poshyradha; December 18th, 2007 at 12:51 PM. Reason: Just now learned to include code tag, so tried implementing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured