Click here to Skip to main content
15,917,642 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: catching memory exception Pin
Stephen Hewitt7-Jun-10 20:59
Stephen Hewitt7-Jun-10 20:59 
QuestionRe: catching memory exception Pin
Niklas L7-Jun-10 21:03
Niklas L7-Jun-10 21:03 
AnswerRe: catching memory exception Pin
Sakhalean7-Jun-10 21:10
Sakhalean7-Jun-10 21:10 
GeneralRe: catching memory exception Pin
Stephen Hewitt7-Jun-10 21:12
Stephen Hewitt7-Jun-10 21:12 
GeneralRe: catching memory exception Pin
Sakhalean7-Jun-10 21:22
Sakhalean7-Jun-10 21:22 
GeneralRe: catching memory exception Pin
Stephen Hewitt7-Jun-10 21:39
Stephen Hewitt7-Jun-10 21:39 
GeneralRe: catching memory exception Pin
Sakhalean7-Jun-10 22:55
Sakhalean7-Jun-10 22:55 
GeneralRe: catching memory exception Pin
Cedric Moonen7-Jun-10 23:18
Cedric Moonen7-Jun-10 23:18 
When posting code, please use the 'code' tag to format it properly.

Anyway, you still didn't post the real useful code: the part where you allocate and deallocate the memory. Without that, it will be very difficult to help you. I also fully agree with the other posters: it seems you don't really understand how to allocate and deallocate the memory properly and catching an exception in those circumstances without fixing the actual problem would be really crazy.

Furthermore, are you sure you want to use arrays of CString ? Do you want to store multiple strings ?
I also encourage you to take a look at std::vector or std::list, because it seems you want to work with arrays of varying size, in which case such a container would make things way more simple.
Additionally, I also encourage you to focus a bit more on encapsulation: as you are using C++, I would provide a constructor and destructor for your structures, which will be responsible to allocate and deallocate the memory properly. Also, the members would be private so that only the structure can allocate memory for the varialbes. This will make your code much more simple and less error prone.
Cédric Moonen
Software developer

Charting control [v3.0]
OpenGL game tutorial in C++

GeneralRe: catching memory exception Pin
Sakhalean8-Jun-10 1:19
Sakhalean8-Jun-10 1:19 
GeneralRe: catching memory exception Pin
Cedric Moonen8-Jun-10 1:30
Cedric Moonen8-Jun-10 1:30 
GeneralRe: catching memory exception Pin
David Crow8-Jun-10 2:58
David Crow8-Jun-10 2:58 
GeneralRe: catching memory exception Pin
Cedric Moonen8-Jun-10 7:53
Cedric Moonen8-Jun-10 7:53 
GeneralRe: catching memory exception Pin
Stephen Hewitt8-Jun-10 14:15
Stephen Hewitt8-Jun-10 14:15 
AnswerRe: catching memory exception Pin
Aescleal7-Jun-10 21:17
Aescleal7-Jun-10 21:17 
QuestionConversion of DWORD to time Pin
Nikesh Jagtap7-Jun-10 20:43
Nikesh Jagtap7-Jun-10 20:43 
AnswerRe: Conversion of DWORD to time Pin
Stephen Hewitt7-Jun-10 21:00
Stephen Hewitt7-Jun-10 21:00 
AnswerRe: Conversion of DWORD to time Pin
Richard MacCutchan7-Jun-10 21:29
mveRichard MacCutchan7-Jun-10 21:29 
AnswerRe: Conversion of DWORD to time Pin
CPallini7-Jun-10 21:43
mveCPallini7-Jun-10 21:43 
QuestionStd::string loadstring??? Pin
gmallax7-Jun-10 20:12
gmallax7-Jun-10 20:12 
AnswerRe: Std::string loadstring??? Pin
Hristo-Bojilov7-Jun-10 20:30
Hristo-Bojilov7-Jun-10 20:30 
AnswerRe: Std::string loadstring??? Pin
Stephen Hewitt7-Jun-10 20:31
Stephen Hewitt7-Jun-10 20:31 
AnswerRe: Std::string loadstring??? Pin
Randor 7-Jun-10 20:44
professional Randor 7-Jun-10 20:44 
JokeRe: Std::string loadstring??? Pin
Randor 7-Jun-10 21:21
professional Randor 7-Jun-10 21:21 
GeneralRe: Std::string loadstring??? Pin
Stephen Hewitt7-Jun-10 21:28
Stephen Hewitt7-Jun-10 21:28 
GeneralRe: Std::string loadstring??? Pin
Randor 7-Jun-10 22:34
professional Randor 7-Jun-10 22:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.