Re: CArray
If you are declaring your array to take your objects by value then your
object will need to have an equal operator, because when you add items to
the array they will be passed by value. So if for some reason your class's
equal operator is not available you will get this error.
There are two ways to remedy this problem, you can either ensure that your
class has an equal operator, or you can declare your array to take pointers
to your class
CArray<Object *,Object *> m_ObjectArray;
AliR.
"GT" <ContactGT_remove_@hotmail.com> wrote in message
news:00e2e7ab$0$25837$c3e8da3@news.astraweb.com...
I have 2 classes in my Model.dll project. I have simplified my Class names
are for this quesion. I have a Category class and an Object class. My
Category class needs to hold an array of Objects, so in my Category class
header file I #include "ProductionArtifactFast.h" and I have a member
variable:
CArray <Object, Object> m_ObjectArray;
My Object class needs to have a pointer to its parent category, so my
Object class forward declares the Category class in the header file and
#includes Category.h in the .cpp file. There is a member variable:
Category *m_pCategory.
On paper this all seems reasonable and I can;t find a problem with the
design, but the problem is that this code won't build. I get unresolved
external linker errors:
1>model.obj : error LNK2019: unresolved external symbol "public: class
Category& __thiscall Category::operator=(class Categoryconst &)"
(??4Category@@QAEAAV0@ABV0@@Z) referenced in function "public: void
__thiscall CArray<class Category,class Categoryconst
&>::SetAtGrow(int,class Categoryconst &)"
(?SetAtGrow@?$CArray@VCategory@@ABV1@@@QAEXHABVCategory@@@Z)
This looks like a problem with the CArray as it mentions SetAtGrow - a
method in CArray, but I have not overridden CArray or called this method,
so I don't understand what it all means. Can anyone point me in the right
direction. Is the problem related to both classes including the other, yet
the Category class holds a CArray of the Object instances?