Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

CArray of CStringArray

Posted on 2002-06-12
4
Medium Priority
?
1,024 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

604 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