itsAnalysisDataTable.CreateEx( WS_EX_CLIENTEDGE, AfxRegisterWndClass( CS_DBLCLKS, LoadCursor( NULL, IDC_ARROW ), (HBRUSH)::GetStockObject( NULL_BRUSH ), NULL ), "AnalysiysTable", WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, dialogItemRect, this, IDC_ANALYSIS_DATA_TABLE );
This line cost me two days without a decision. itsAnalysisDataTable is a Windows user control that has CWnd as its great great parent. The control was successfully used in other steps without any problems in our code. this is CPropertyPage.
The problem I have is the causes of the line (and it does it every time) Unhandled exception at 0x76f7fd5c in MyProduct (x64) .exe: 0xC015000F: the deactivated activation context is not the last activated.
An exception occurs in the 32-bit version. I am on Windows 7 x64, VS 2008.
What I already tried:
- Enabling the win32 exception interrupt in the debugger. An exception does not occur (except for exceptions from the first chances, which in our code are many and have no effect)
- Recompilation of the whole project
- Debugging OnCreate handler for exception management.
Call stack:
ntdll.dll!0000000076f7fd5c() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] kernel32.dll!0000000076df42d3() mfc90d.dll!AfxDeactivateActCtx(unsigned long dwFlags=0, unsigned __int64 ulCookie=2077018657900210161) Line 260 + 0x19 bytes C++
remarks:
- If I skip the WS_CHILD flag, an exception does not occur, but OnCreate is also not called in the control!
- If I ignore the exception and continue, the application works fine, management also works fine.
- A call to AfxSetAmbientActCtx (FALSE) during application startup throws an exception. But I think this is a hack if I can not justify it.
source share