Problems with CArray Updated
-
Hi, i believe that i have a problem to create a instance of the following object. Declaration : CArray <CEndPointGroup*,CEndPointGroup*> m_arEndPointGroups; Add Pointer : CEndPointGroup* _pEndPointGroup = NULL; _pEndPointGroup = new CEndPointGroup(_groupname); m_arEndPointGroups.Add(_pEndPointGroup); At the last line i get an error. It seems that the arEndPointGroups-object is wrong allocated. What do i wrong ? Marco
-
Hi, i believe that i have a problem to create a instance of the following object. Declaration : CArray <CEndPointGroup*,CEndPointGroup*> m_arEndPointGroups; Add Pointer : CEndPointGroup* _pEndPointGroup = NULL; _pEndPointGroup = new CEndPointGroup(_groupname); m_arEndPointGroups.Add(_pEndPointGroup); At the last line i get an error. It seems that the arEndPointGroups-object is wrong allocated. What do i wrong ? Marco
What kind of error it is? Compiler error? Assert at runtime? Hardware error? Tomasz Sowinski -- http://www.shooltz.com
Free your mind and your ass will follow.
-
What kind of error it is? Compiler error? Assert at runtime? Hardware error? Tomasz Sowinski -- http://www.shooltz.com
Free your mind and your ass will follow.
-
It's an assert error at runtime. Pointer Access Error ! i've tried only to make an array of CEndPointsGroup-Pointer. :( Marco
Have a look at call stack. Where (file/line) is ASSERT located? Tomasz Sowinski -- http://www.shooltz.com
Free your mind and your ass will follow.
-
Hi, i believe that i have a problem to create a instance of the following object. Declaration : CArray <CEndPointGroup*,CEndPointGroup*> m_arEndPointGroups; Add Pointer : CEndPointGroup* _pEndPointGroup = NULL; _pEndPointGroup = new CEndPointGroup(_groupname); m_arEndPointGroups.Add(_pEndPointGroup); At the last line i get an error. It seems that the arEndPointGroups-object is wrong allocated. What do i wrong ? Marco
Do you have looked at CPtrArray? Maybe that helps. BTW CArray is deprecated, nonstandard and broken. You are better off using a std::vector or even a std::vector> Just remember to never use std::auto_ptr in a std:: container.
-
Do you have looked at CPtrArray? Maybe that helps. BTW CArray is deprecated, nonstandard and broken. You are better off using a std::vector or even a std::vector> Just remember to never use std::auto_ptr in a std:: container.
jhwurmbach wrote: BTW CArray is deprecated, nonstandard and broken Nonstandard, yes. But I'd appreciate if you'd explain 'broken' and 'deprecated' part. Tomasz Sowinski -- http://www.shooltz.com
Free your mind and your ass will follow.
-
jhwurmbach wrote: BTW CArray is deprecated, nonstandard and broken Nonstandard, yes. But I'd appreciate if you'd explain 'broken' and 'deprecated' part. Tomasz Sowinski -- http://www.shooltz.com
Free your mind and your ass will follow.
Broken: http://www.codeproject.com/cpp/ocarray.asp[^] or http://www.codeproject.com/cpp/carray_pitfall.asp[^] The use of 'pitfall' is the same as MS using 'issue': Politically correct term for 'ERROR' Meaning: CArray and references don't work. Deprecated: CArray is what MS had to come up with when the STL was not working, but they needed the functionality for MFC. Since the time the standard was released, there is no need to use these old nostandard CArray.