Bizarre problem with LArray

Bizarre problem with LArray

Post by Kurt » Thu, 21 Aug 2003 04:32:49


Hello,

I have a strange problem accessing elements of an LArray from within a
networking task. From several different methods, I do something like:

int i = 1;
SMessageSetInUse* inUse;
Boolean found = mMessageSetArray->FetchItemAt( i, inUse);

Most of the time this works fine. But when called at the end of the
task, found is true, but inUse is nil; All data members of the LArray
look fine, identical to before when it works. The strange part is that
when it works, before calling FetchItemAt, inUse looks like a proper
pointer in the CW de *** . It has a disclosure triangle which when
revealed, shows the data members of my SMessageSetInUse class. When it
doesn't work, inUse has no disclosure triangle and shows 0x000000 in
the de *** , which is odd since I don't initialize it to nil.

If my virtual function table was wiped out, I would expect the app to
crash badly, and it doesn't. But for some reason the de *** no longer
knows about the SMessageSetInUse class. Something is screwed up. After
stepping through the code countless times, everything looks perfect,
except that pointer.

Anyone have any idea what could be going on?

Kurt
 
 
 

Bizarre problem with LArray

Post by Kurt » Thu, 21 Aug 2003 10:19:23

On Tue, 19 Aug 2003 15:32:49 -0400, Kurt wrote
(in message <0001HW.BB67F39F0238446A1BE30890@news-server>):


Nevermind. I use subclasses of TArray throughout my program and am used
to passing pointers, not their addresses, to InsertItemsAt and
FetchItemAt. I didn't realize the interface was different with LArray.

Kurt