Unhandled exception at 0x1b97d783 (mfc71d.dll) in graf.exe: User breakpoint.
-
this occurs while iam trying to use domodal() only in debug mode.. it works fine in release mode. help me to get rid of this...
If it happens in debug mode, then have you tried debugging it? Work backwards from the exception, and find out what wrong information you're giving to MFC? Iain.
-
this occurs while iam trying to use domodal() only in debug mode.. it works fine in release mode. help me to get rid of this...
Maybe posting the code where exception happens will help. I can guess it is an
ASSERT
though. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
[my articles] -
Maybe posting the code where exception happens will help. I can guess it is an
ASSERT
though. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
[my articles]Its in appcore.cpp // CWinApp diagnostics #ifdef _DEBUG void CWinApp::AssertValid() const { CWinThread::AssertValid(); ASSERT(afxCurrentWinApp == this);
ASSERT(afxCurrentInstanceHandle == m_hInstance);
if (AfxGetThread() != (CWinThread*)this) return; // only do subset if called from different thread if (m_pDocManager != NULL) ASSERT_VALID(m_pDocManager); } -
Its in appcore.cpp // CWinApp diagnostics #ifdef _DEBUG void CWinApp::AssertValid() const { CWinThread::AssertValid(); ASSERT(afxCurrentWinApp == this);
ASSERT(afxCurrentInstanceHandle == m_hInstance);
if (AfxGetThread() != (CWinThread*)this) return; // only do subset if called from different thread if (m_pDocManager != NULL) ASSERT_VALID(m_pDocManager); }As you can see, you don't get an exception on release version, because the code is inside
_DEBUG
guard (BTWASSERT
itsef is guarded by_DEBUG
). Anyway it seems your application'sm_Instance
has not the proper value, maybe you have to check its value with the debugger. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
[my articles] -
this occurs while iam trying to use domodal() only in debug mode.. it works fine in release mode. help me to get rid of this...
Neels wrote:
it works fine in release mode.
No, it only APPEARS to work. The problem exists in both, but because of the differences in the way each is compiled, variables are initialized, etc, the problem has simply been moved or masked.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne