CArray Question
-
In my .h file I am declaring a CArray like so: CArray m_Array; I get the following complaints from C++.NET many times over: error C2143: syntax error : missing ';' before '<' error C2238: unexpected token(s) preceding ';' error C2501: 'CDerivedDialogBarView::CArray' : missing storage-class or type specifiers I have checked around this site and others and can't seem to put this together. Surely this is a beginners mistake or something. Suggestions? TIA. Matt (Padawan Learner)
-
In my .h file I am declaring a CArray like so: CArray m_Array; I get the following complaints from C++.NET many times over: error C2143: syntax error : missing ';' before '<' error C2238: unexpected token(s) preceding ';' error C2501: 'CDerivedDialogBarView::CArray' : missing storage-class or type specifiers I have checked around this site and others and can't seem to put this together. Surely this is a beginners mistake or something. Suggestions? TIA. Matt (Padawan Learner)
i can't if you are using CArray incorrectly or if you're using the CP boards incorrectly :) don't take that as an insult - i'll explain: CArray is a template class. you can't just declare a CArray, you have to declare a CArray of some object type:
// important
#include < afxtempl.h>// declaration
CArray < myType, myType& > m_Array;the CP comment was because CP's boards will eat < tags if you're not careful, so i couldn't tell if you had template params or if the board ate them :) oh yeah, and std::vector is a better array in nearly all respects. -c
Image tools: ThumbNailer, Bobber, TIFFAssembler
-
i can't if you are using CArray incorrectly or if you're using the CP boards incorrectly :) don't take that as an insult - i'll explain: CArray is a template class. you can't just declare a CArray, you have to declare a CArray of some object type:
// important
#include < afxtempl.h>// declaration
CArray < myType, myType& > m_Array;the CP comment was because CP's boards will eat < tags if you're not careful, so i couldn't tell if you had template params or if the board ate them :) oh yeah, and std::vector is a better array in nearly all respects. -c
Image tools: ThumbNailer, Bobber, TIFFAssembler
My bad.:laugh: I was missing the #include < afxtempl.h> Thanks. It's been a long day(or night).