Strange CObArray access violation

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I have a CObArray which I've been using for some time within a class
(derived from CDocument). I've added a new member function which
throws an access violation exception every time I try to access the
array.

The exception is thrown with the following line:

int arraySize = m_AtomArray.GetSize();

The access violation shows up here:

_AFXCOLL_INLINE int CObArray::GetSize() const
{ return m_nSize; }

I have initialized the array within the Class initialization list, and
successfully traced the size of that array within the class
constructor. As I have already mentioned, other member functions
access the array with no problems.

I am very confused about this! - any ideas?

Thanks

Tim

.



Relevant Pages

  • Re: Code explain...
    ... also declared as static in a member function meaing that it's lifetime ... Node appears to be a data member of type array of array of NodeData, ... So Nodeis an object of type NodeData. ... NodeData's declaration is missing from your code. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: A challenge: Routing algorithm in C++
    ... Then a method (member function in C++) which compares 2 units should ... Then parse the array and put each unit into its own Unit object. ... If K is needed loop over the sorted vector and set K for each Unit ...
    (comp.programming)
  • Re: assignment operator=
    ... > language special edition" and found nothing related. ... does whatever to an array, you can wrap such an array ... inside a class, and create an operator=member function, ...
    (comp.lang.cpp)
  • storing classes
    ... Is it possible to store classes in an array? ... which are stored in a database. ... the notes from the database, storing each one in a seperate class, ... "Cannot use a scalar value as an array", and "Call to a member function ...
    (comp.lang.php)
  • Re: Access violation?
    ... But, when destroying the form, I get an access violation, after ... when setting the array of boolean to 0 ... A memory leak does not manifest as an access violation. ... The problem was the array. ...
    (comp.lang.pascal.delphi.misc)