Click here to Skip to main content
15,889,861 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,

I am getting Memory Exception when appending a Long String to CString many times.

Code
----

C++
try
{
for(int i=0;i<100; i++)
{
..
..
..
pQueryInfo->m_strQueryText += strQueryText; // Appending String --> MemoryException.
}
}catch(CMemoryException *e){
e->Delete();
}


pQueryInfo->m_strQueryText and strQueryText are CString Variables.After appending a Long String many times i am getting this CMemoryException. How can it be
resolved. Help me out.

Thanks
Uday
Posted
Updated 23-Oct-13 22:15pm
v2
Comments
Bernhard Hiller 24-Oct-13 2:08am    
Duplicate of http://www.codeproject.com/Questions/673102/CString-Appending-getting-CMemoryExcepton

Probably it can be resolved revising your plans. First of all, do you really need to create such a (possibly useless) monster?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900