Hi!
I have a class called anItem which is defined something like this :
class anItem
{
CString string1;
CString string2;
long bla1;
long bla2;
}
ok should be enough. Constructor/Destructor are empty.
At another place I use this class as a template for a std::list.
std::list<anItem> list;
I can add and get items from that list without any problem, UNLESS I do the following.
If I add another Item to the anItem-class, it only works if it is not a CString type.
Examples :
class anItem
{
CString string1;
CString string2;
char string3[10000]; //new char array
long bla1;
long bla2;
}
above is OK!
class anItem
{
CString string1;
CString string2;
CString string3; // new CString
long bla1;
long bla2;
}
Runtime Error ("Memory could not be read.").
Does any of you have an idea what the problem here is?
I am using MS Visual C++ 6.0; this is used in an MFC application.
Thanks!