The CAtlArray class does not have a SetSize method. Use CAtlArray::SetCount. ATL does not guarantee 0 initialized members. For example, if a CAtlArray object contained class instances SetCount would allocate memory and then call the default constructor for the class,. An implementation detail is that the calloc function is used to allocate memory so that will initialize the allocated memory to 0. So a CAtlArray object containing pointers will get NULLs in the newly allocated members.
Does CAtlArray initialize element to zero or not?

drjackool
956
Reputation points
Hi
Does CAtlArray initialize element to zero or I have to set them to zero after calling SetSize() method?
I using this array to hold pointers!
CAtlArray<somestruct*> m_aItem;
Thanks