Solved

CArray of CStringArray

Posted on 2002-06-12
4
947 Views
Last Modified: 2013-11-20
Hi all!

Got a little problem, my CArray is declared like that:

CArray< CStringArray , CStringArray& > cZoneArray;

And i try to fill it like that:

        CStringArray tempArray;
        CString tempString;

        //Numéro de la zone
        tempArray.Add( "1" );

        //Prendre le minScan
        m_EditMinScanDiam.GetWindowText( tempString );
        tempArray.Add( tempString );

        //Prendre le maxScan
        m_EditMaxScanDiam.GetWindowText( tempString );
        tempArray.Add( tempString );

        cZoneArray.Add( tempArray );

But I get this puzzling error:

d:\...\afxtempl.h(443) : error C2582: 'CStringArray' : 'operator =' function is unavailable
d:\...\afxtempl.h(1566) : while compiling class-template member function 'void __thiscall CArray<class CStringArray,class CStringArray &>::SetAtGrow(int,class CStringArray &)'


What am i doing wrong here?

Thanks!

Moonover
0
Comment
Question by:David MacDonald
  • 2
  • 2
4 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 50 total points
ID: 7073259
>>What am i doing wrong here?

'CStringArray' doesn't have an 'operator=()', as the compiler is mentioning, so that won't work. There are two options:

- derive your own class from 'CStringArray' and add the operator
- store pointers to 'CStringArray' in the CArray, not instances
0
 
LVL 1

Author Comment

by:David MacDonald
ID: 7073341
Ok, if I store pointers to StringArrays and after that serialize the CArray that contains the pointers,
will the data be serialized or only the addresses of my StringArrays?
0
 
LVL 86

Expert Comment

by:jkr
ID: 7073360
That's a good question - it depends on how you implement that.
0
 
LVL 1

Author Comment

by:David MacDonald
ID: 7073366
Ok, that's a good start, i'll serialize it manually, it won't be too messy...

Thanks a lot jkr!
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now