Newbie Question CStringArray 
Author Message
 Newbie Question CStringArray

Hi!!

I have an app that bascially has a loop that fills a CStringArray with some
data, then issues a ::RemoveAll() and once again fills that same
CStringArray with some new data..  This loops runs fine for several hours
then the program get a "Out of Memery error?

I'm assuming that each time I call ::RemoveAll () its freeing the data &
memory and then when I call ::Add() or ::Append() it is grabbing memory,
each time the memory is getting more fragmented.  Is their a way around
this?

Any suggestion would be appreciated, thanks in advance, rks...



Fri, 01 Dec 2000 03:00:00 GMT  
 Newbie Question CStringArray


Quote:
>Hi!!

>I have an app that bascially has a loop that fills a CStringArray with some
>data, then issues a ::RemoveAll() and once again fills that same
>CStringArray with some new data..  This loops runs fine for several hours
>then the program get a "Out of Memery error?

>I'm assuming that each time I call ::RemoveAll () its freeing the data &
>memory and then when I call ::Add() or ::Append() it is grabbing memory,
>each time the memory is getting more fragmented.  Is their a way around
>this?

>Any suggestion would be appreciated, thanks in advance, rks...

RemoveAll() does not free the memory of the objects.
If you do help on RemoveAll, it says:

"Removes all the pointers from this array but does not actually delete the
CObject objects."

--

David Hart
To reply, remove the XXX from my email address:



Fri, 01 Dec 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Newbie Question CStringArray

2. Newbie Question CStringArray

3. CArray<CStringArray, CStringArray&>

4. Newbie: Another problem using CStringArray

5. Newbie: problem using CStringArray

6. Newbie: CATALOG sample question (SIMPLE question)

7. Newbie question ( certainly stupid question)

8. Newbie question: C++ beginner question

9. CFile/CCommon dialog question and DAO open question (yes, I'm a newbie)

10. Yet another CListCtrl() question from a newbie (sort question) on Dialog based project

11. Return a CStringArray from an ADO component

12. What is the difference - CStringArray and CString

 

 
Powered by phpBB® Forum Software