?
Solved

CArray of CStringArray

Posted on 2002-06-12
4
Medium Priority
?
1,002 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 200 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

752 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