Hello,
My application got hung giving a popup message that application busy wait or close.
I created a dump file to analyse before closing the application. Below is the call stack. I could not get the root cause.
The function of my application which call stack is pointing (spos!CWnd::BringWindowToTop) executes fine normally.
Do not know why it failed.
Below is the stack:
000e3e2c 0042aac4 0000004e 00b6000c 000fb380 ntdll!KiFastSystemCallRet
000e3e3c 0088b56f 0b911978 00000000 00405637 spos!CWnd::BringWindowToTop+0x14 [C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE\afxwin2.inl @ 94]
000fb380 5f401e6e 00001f40 0b911978 0b911978 spos!CSposView::OnTimer+0x92dd [C:\DEVTCS\POS\Legacy\SPOS_MIDCOUNTIES-272AutoRefund\sposView.cpp @ 4452]
000fb3fc 5f401aff 00000113 00001f40 00a2d8d8 mfc42!Ordinal5163+0x34d
000fb41c 5f401a88 00000113 00001f40 00000000 mfc42!Ordinal6374+0x22
000fb47c 5f401a10 00000000 000b0100 00000113 mfc42!Ordinal1109+0x74
000fb498 5f4019cf 000b0100 00000113 00001f40 mfc42!Ordinal1578+0x2a
000fb4c4 7714c4e7 000b0100 00000113 00001f40 mfc42!Ordinal1579+0x39
000fb4f0 7714c5e7 5f401996 000b0100 00000113 user32!gapfnScSendMessage+0x1cf
000fb568 7714cc19 00000000 5f401996 000b0100 user32!gapfnScSendMessage+0x2cf
000fb5c8 77142e41 5f401996 00000001 00000fa0 user32!gapfnScSendMessage+0x901
000fb5d8 0ca2b67f 000fb5f8 0000000a 0db10340 user32!DispatchMessageA+0xf
00000fa0 00000000 00000000 00000000 00000000 WN_DrawRS232!DllUnregisterServer+0x9daf
basically below portion is what windbg is referring to:
if(nIDEvent == FOCUS_TIMER && !WINCOR_IF())
{
try
{
if(theApp.pActiveDialog != NULL && IsWindow(theApp.pActiveDialog->m_hWnd))
{
CWnd * CurrentWindow = GetActiveWindow();
if(CurrentWindow->m_hWnd != theApp.pActiveDialog->m_hWnd )
{
theApp.pActiveDialog->BringWindowToTop();
theApp.pActiveDialog->SetFocus();
theApp.pActiveDialog->RedrawWindow();
CString OutMessage;
CString cstrCurrent;
CurrentWindow->GetWindowText(cstrCurrent);
CString cstrActive;
theApp.pActiveDialog->GetWindowText(cstrActive);
OutMessage.Format("** Active Window has not got focus. Current Window = '%s' attempting to set '%s' as the active window",cstrCurrent,cstrActive);
LogErrorMessage(__LINE__,__FILE__,OutMessage);
}
}
}
catch(...)
{
theApp.pActiveDialog = NULL;
}
Though it happened only once. and it worked fine on next execution. Could it be anything related to windows issue?