Hi Wanting2LearnMan,
a stack overflow most probably results from calling a function recursive which never terminates (or i.e. two functions which call each other or a message handler function which itself causes the handled message to be sent, i.e. calling RedrawWindow from a WM_PAINT message handler).
The problem here is that the call stack cannot e displayed any more so you can only locate the problem by debugging - first set a breakpoint in CMainMenu::OnInitDialog and step through its code and see if the stack overflow happens there.
Since it seems the stack overflow results from a message handler function maybe a possibility to find the message which causes the problem by using the 'Spy++' tool - start the application, then find the window with Spy++, select 'Spy->Log messages', then press the launch button. This way maybe you will see which messages are sent until the stack overflow happens.
The assertion in 'afxwin2.inl' simply indicates that CWnd::GetFont() is called for a CWnd-object which isn't attached to a existing window. Do you see in the call stack from where the 'GetFont' was called?
Hope that helps,
ZOPPO
Main Topics
Browse All Topics





by: Wanting2LearnManPosted on 2009-05-20 at 03:51:18ID: 24430319
Now when I try to dun this in debug on my actual device I get the following problem at the above line of code:
Program.ex e ip\altmfc\ include\af xwin2.inl Line 63
!
Debug Assertian Failed
Program: \ProgramFIles\MyProgram\My
File: f:\sp\vctools\vc7libsce\sh
(Press Retry to debug the application )
Why is this happening????????? arrrrrrrrrrrrrrrghhhhhhhhh