question: what is the stack size in MFC objects?  
Author Message
Pascal_schwartz





PostPosted: Visual C++ Language, question: what is the stack size in MFC objects? Top

Hi All

I have two small questions,

1. about the stack/heap size allowed in the MFC class like the CDialog class object

2. it safe to use CString class, some times i getting error concerning the stack when using the CString class.

Pascal




Visual C++1  
 
 
Sarath.





PostPosted: Visual C++ Language, question: what is the stack size in MFC objects? Top

AFAIK stack and heap is not associated to any objects. The stack memory is allocated while we creates a thread. The default stack and heap size is 1 MB. You can specify the stack size while creating a thread/fork.
If you are building an EXE, you can set the size of stack in linker options using /STACK option.
you can specify the heap size using /HEAP:reserve[,commit]

This article would help you to know something more about different type of Heaps


 
 
Marius Bancila





PostPosted: Visual C++ Language, question: what is the stack size in MFC objects? Top

it safe to use CString class, some times i getting error concerning the stack when using the CString class

What kind of errors There shouldn't be any. If you have errors, than it's likely that somehow you alter the stack (like for example writing arrays beyond their bounds) in some other part of the code.



 
 
Simple Samples





PostPosted: Visual C++ Language, question: what is the stack size in MFC objects? Top

A common cause of errors concerning the stack is recursion. You might have an infinite loop that includes recursion.

 
 
Damien Watkins - MSFT





PostPosted: Visual C++ Language, question: what is the stack size in MFC objects? Top

Hello

Re: question: what is the stack size in MFC objects

I am going to mark this thread as answered since you have not followed up with any further information on your problem as requested for over a week - I assume you solved the problem yourself or one of the suggestions in this thread helped you solved the problem. If you have a solution you could post it so others can find it. If you do not have a solution then please submit further details and then mark the thread as unanswered.

Thanks

Damien

--

PS: In hindsight however, the more appropriate place for your question was probably the MFC newsgroup: http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.vc.mfc&lang=en&cr=US