Click here to Skip to main content
15,898,035 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCheck Menu Pin
Selevercin14-Apr-03 12:47
Selevercin14-Apr-03 12:47 
GeneralRe: Check Menu Pin
Miszou14-Apr-03 13:11
Miszou14-Apr-03 13:11 
GeneralRe: Check Menu Pin
Selevercin14-Apr-03 13:43
Selevercin14-Apr-03 13:43 
GeneralRe: Check Menu Pin
Miszou14-Apr-03 13:53
Miszou14-Apr-03 13:53 
GeneralRe: Check Menu Pin
Selevercin15-Apr-03 13:23
Selevercin15-Apr-03 13:23 
GeneralMulti-dimensional Arrays Pin
ed114-Apr-03 11:47
ed114-Apr-03 11:47 
GeneralRe: Multi-dimensional Arrays Pin
Joe Woodbury14-Apr-03 11:57
professionalJoe Woodbury14-Apr-03 11:57 
GeneralRe: Multi-dimensional Arrays Pin
Dave Bryant14-Apr-03 12:01
Dave Bryant14-Apr-03 12:01 
Since you are storing an array of objects, rather than an array of pointers, the objects will be copied into the array. This means that C++ uses the autogenerated assignment operator for STest. However, the CArray template class disables both the copy constructor and the assignment operator, therefore disabling simple copies of the array.

There are a number of solutions for this. Here's a few:

1) Store STest pointers in the outer array instead of objects. This means that only the pointers are copied rather than the entire object (and hence the inner CArray is not copied). This means that the objects must be allocated and deallocated manually on the heap.

2) Use std::vector instead of CArray. This is much better implementation overall, and does not have the copying limitation either.

BTW, when posting on codeproject, use &lt; and &gt; instead of < and >, otherwise they look like HTML tags and so are not displayed.

Dave
http://www.cloudsofheaven.org
GeneralRe: Multi-dimensional Arrays Pin
(Steven Hicks)n+114-Apr-03 12:52
(Steven Hicks)n+114-Apr-03 12:52 
GeneralImage recording Pin
alex.barylski14-Apr-03 11:04
alex.barylski14-Apr-03 11:04 
GeneralRe: Image recording Pin
Jack Handy14-Apr-03 11:26
Jack Handy14-Apr-03 11:26 
GeneralRe: Image recording Pin
alex.barylski14-Apr-03 11:49
alex.barylski14-Apr-03 11:49 
GeneralRe: Image recording Pin
J. Dunlap14-Apr-03 11:40
J. Dunlap14-Apr-03 11:40 
GeneralUsing a CAB file within VC Pin
OBRon14-Apr-03 11:02
OBRon14-Apr-03 11:02 
GeneralSony LCD monitor (french) Pin
jancsi14-Apr-03 10:57
jancsi14-Apr-03 10:57 
GeneralRe: Sony LCD monitor (french) Pin
Michael Dunn14-Apr-03 11:09
sitebuilderMichael Dunn14-Apr-03 11:09 
GeneralRe: Sony LCD monitor (french) Pin
jeremysay14-Apr-03 23:44
jeremysay14-Apr-03 23:44 
QuestionHow to delete a file in MFC Pin
Anonymous14-Apr-03 10:34
Anonymous14-Apr-03 10:34 
AnswerRe: How to delete a file in MFC Pin
Chris Losinger14-Apr-03 10:37
professionalChris Losinger14-Apr-03 10:37 
AnswerRe: How to delete a file in MFC Pin
Joe Woodbury14-Apr-03 10:37
professionalJoe Woodbury14-Apr-03 10:37 
GeneralRe: How to delete a file in MFC Pin
gmlnd14-Apr-03 10:41
gmlnd14-Apr-03 10:41 
GeneralRe: How to delete a file in MFC Pin
Selevercin14-Apr-03 13:49
Selevercin14-Apr-03 13:49 
GeneralRe: How to delete a file in MFC Pin
David Crow15-Apr-03 4:52
David Crow15-Apr-03 4:52 
Generalinitializing Pin
K. Shaffer14-Apr-03 10:31
K. Shaffer14-Apr-03 10:31 
GeneralRe: initializing Pin
Chris Losinger14-Apr-03 10:36
professionalChris Losinger14-Apr-03 10:36 

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.