Using SDL to create window for rendering engine that uses Vulkan. Following this code. Following is the snippet of interest:
SDL_Init(SDL_INIT_VIDEO);
SDL_WindowFlags window_flags = (SDL_WindowFlags)(SDL_WINDOW_VULKAN);
_window = SDL_CreateWindow(
"Vulkan Engine",
SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED,
_windowExtent.width,
_windowExtent.height,
window_flags
);
I'm using Visual Studio 2019. Saw this error, built SDL from source as this answer suggested Vulkan flag may not have been enables in the posted binaries. Still, getting error on window creation. Line by line debugging points to this as the line where things break:
return CallWindowProc(data->wndproc, hwnd, msg, wParam, lParam);
in SDL_windowsevents.c.
Exception:
Exception thrown at 0x00007FFF584A4F8E (ntdll.dll) in GraphicsModel.exe: 0xC00000FD: Stack
overflow (parameters: 0x0000000000000001, 0x000000ED25003FB8).
Unhandled exception at 0x00007FFF584A4F8E (ntdll.dll) in GraphicsModel.exe: 0xC000041D: An unhandled exception was encountered during a user callback.
Let me know if I should paste the full stacktrace. Can't figure out what's the cause, any help would be great!
Edit: Callstack (confirms infinite recursion)
ntdll.dll!00007ffb84e44f8e() Unknown
user32.dll!00007ffb83345aa4() Unknown
user32.dll!00007ffb833458ee() Unknown
mfc140ud.dll!00007ffaf0091b05() Unknown
user32.dll!00007ffb83345c1d() Unknown
user32.dll!00007ffb833458ee() Unknown
SDL2.dll!0000000075e4e7d0() Unknown
user32.dll!00007ffb83345c1d() Unknown
user32.dll!00007ffb833458ee() Unknown
mfc140ud.dll!00007ffaf0091b05() Unknown
user32.dll!00007ffb83345c1d() Unknown
user32.dll!00007ffb833458ee() Unknown
THIS BLOCK REPEATS 'n' times
---------------------------------------
SDL2.dll!0000000075e4e7d0() Unknown
user32.dll!00007ffb83345c1d() Unknown
user32.dll!00007ffb833458ee() Unknown
mfc140ud.dll!00007ffaf0091b05() Unknown
user32.dll!00007ffb83345c1d() Unknown
user32.dll!00007ffb833458ee() Unknown
---------------------------------------
SDL2.dll!0000000075e4e7d0() Unknown
user32.dll!00007ffb83345c1d() Unknown
user32.dll!00007ffb833457ec() Unknown
user32.dll!00007ffb83354432() Unknown
> ntdll.dll!00007ffb84ec0b04() Unknown
win32u.dll!00007ffb82ea1524() Unknown
SDL2.dll!0000000075e58ebe() Unknown
SDL2.dll!0000000075e2172d() Unknown
GraphicsModel.exe!VulkanEngine::init() Line 59 C++
GraphicsModel.exe!CMainFrame::OnCreate(tagCREATESTRUCTW * lpCreateStruct) Line 67 C++
[External Code]
GraphicsModel.exe!CGraphicsModelApp::InitInstance() Line 106 C++
[External Code]
GraphicsModel.exe!wWinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, wchar_t * lpCmdLine, int nCmdShow) Line 26 C++
[External Code]
Related
I have an old MFC application I am updating and I just added a ribbon (using the CMFCRibbonBar class).
However any commands in the quick access toolbar on the ribbon that cause a change in state (eg closing the file and exiting to the main menu) cause a crash when the command is used from the quick access toolbar but not the normal ribbon button.
The crash happens in the MFC file afxribbonbar.cpp in OnMouseMove()
if (pHit != m_pHighlighted)
{
PopTooltip();
if (m_pHighlighted != NULL)
{
ASSERT_VALID(m_pHighlighted);
m_pHighlighted->m_bIsHighlighted = FALSE;
m_pHighlighted->OnHighlight(FALSE);
InvalidateRect(m_pHighlighted->GetRect());
m_pHighlighted = NULL;
}
It crashes on the InvalidateRect line, because m_pHighlighted seems to exist but have no data, so either the stack is corrupted or m_pHighlighted doesn't exist anymore.
I have some lines to reload where all the frames were last time the user was in the new state and I found if I comment out the lines when I change state the crash doesn't happen:
theApp.SaveState(this, ToolbarKey(i_oldAppState));
and
theApp.LoadState( this, ToolbarKey(i_newAppState) );
But ideally I want these lines as otherwise all the windows and frames revert to their default state and users have to resize everything again.
It feels like the entries in the quick access toolbar are being destroyed and recreated when I change state, but I can't find where MFC does this, or a way to set the highlighted entry to null.
EDIT: The crash is an unhandled exception due to an access reading violation in mfc140u.dll. The crash happens deep in the MFC code, well away from anything I have written.
The call stack when this unhandled exception occurs is:
mfc140u.dll!CBasePane::get_accValue(tagVARIANT varChild, wchar_t * * pszValue) Line 1494 C++
mfc140u.dll!CMFCRibbonBar::OnMouseMove(unsigned int nFlags, CPoint point) Line 2348 C++
mfc140u.dll!CMFCRibbonBar::OnLButtonUp(unsigned int nFlags, CPoint point) Line 2276 C++
mfc140u.dll!CWnd::OnWndMsg(unsigned int message, unsigned __int64 wParam, __int64 lParam, __int64 * pResult) Line 2698 C++
mfc140u.dll!CWnd::WindowProc(unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 2099 C++
mfc140u.dll!CBasePane::WindowProc(unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 1020 C++
mfc140u.dll!CMFCRibbonBar::WindowProc(unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 4884 C++
mfc140u.dll!AfxCallWndProc(CWnd * pWnd, HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 265 C++
mfc140u.dll!AfxWndProc(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 417 C++
mfc140u.dll!AfxWndProcBase(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 299 C++
user32.dll!UserCallWinProcCheckWow() Unknown
user32.dll!DispatchMessageWorker() Unknown
user32.dll!IsDialogMessageW() Unknown
mfc140u.dll!CWnd::IsDialogMessageW(tagMSG * lpMsg) Line 194 C++
[Inline Frame] mfc140u.dll!CWnd::PreTranslateInput(tagMSG *) Line 4606 C++
mfc140u.dll!CBasePane::PreTranslateMessage(tagMSG * pMsg) Line 1057 C++
mfc140u.dll!CMFCRibbonBar::PreTranslateMessage(tagMSG * pMsg) Line 3734 C++
mfc140u.dll!CWnd::WalkPreTranslateTree(HWND__ * hWndStop, tagMSG * pMsg) Line 3379 C++
mfc140u.dll!AfxInternalPreTranslateMessage(tagMSG * pMsg) Line 233 C++
mfc140u.dll!AfxInternalPumpMessage() Line 178 C++
mfc140u.dll!CWinThread::Run() Line 629 C++
I had the same bug in the BCG Library. I Made my private fix there for the variables m_pHighlighted and m_pPressed.
BOOL CBCGPRibbonBar::LoadState (LPCTSTR lpszProfileName, int nIndex, UINT uiID)
{
// 2014-04-23 mri: we need to clear pointer to may be active elements that
// may get deleted, when LoadState is executed.
// We cannot set m_pActiveCategory to NULL!!!! This get us into problems when the
// program starts and the minimize/maximize button is used, when this pointer is
// NULL.
m_pHighlighted = NULL;
m_pPressed = NULL;
You should set them to nullptr before you call LoadState
As I remember the problem ist that a click in the ribbon is handled in the Mouse-Down message. So the Mouse-Up message is never executed that clears this member...
I am running into a very strange issue with my mfc c++ program on newer Windows 10 builds. Specifically 20H2 (Build 19042).
When launching a specific dialog from my main menu PCs running this OS build crash silently, without warning.
I have gained access to dump files and determined the issue to be
"Unhandled exception thrown: read access violation. pWnd -> was 0x33312E" with exception code 0xC0000005
This was thrown inside of wincore.cpp on line 265
IResult = pWnd->WindowProc(nMsg, wParam, lParam);
Looking at the disassembly for this line it fails here...
0053A92C mov eax,dword ptr [pWnd] (pWnd is 0x0019f4a4)
0053A92F mov ecx,dword ptr [eax] (eax is 0x0019f4a4)
(ecx is 0x0033312E)
0053A931 mov edx,dword ptr [ecx+11Ch] (Unhandled exception here)
Call stack looks like this.
Program.exe!AfxCallWndProc(CWnd* pWnd, HWND__* hand, unsigned int nMsg, unsigned int wParam, long iParam) line 265
Program.exe!AfxWndProc(HWND__* hWnd, unsigned int nMsg, unsigned int wParam,long iParam) line 418
user32.dll!__InternalCallWinProc#20()
user32.dll!UserCallWinProcCheckWow()
user32.dll!DispatchClientMessage()
user32.dll!___fnDWORD#4()
ntdll.dll!_KiUserCallbackDispatcher#12()
Program.exe!CWND::UpdateWindow() line 106
Program.exe!CWND::RunModalLoop(unsigned long dwFlags) line 4632
Program.exe!CWND::CreateRunDlgIndirect(const DLGTEMPLATE * lpDialogTemplate, CWnd* pParentWnd, HINSTANCE__ * hInst) line 470
Program.exe!CDialog::DoModal() line 633
Program.exe!CMainDlg::OnDeviceButton() line 1271
Here is the code in OnDeviceButton()
Void CMainDlg::OnDeviceButton()
{
CDevice device;
device.deviceType = 7;
device.DoModal();
}
Here is code from CDevice
BOOL CDevice::OnInitDialog()
{
CDialog::OnInitDialog();
CloseCPC();
deviceList.SetExtendedStyle(LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT);
deviceList.InsertVolumn(0, _T("Device"), LVCFMT_LEFT, 150);
deviceList.InsertColumn(1, _T("Software Version"), LVCFMT_CENTER. 100);
deviceList.InsertItem(0, _T("BRTB"));
SetupVersionTree();
SetTimer(1,1,NULL);
Sleep(20);
return TRUE;
}
Void CDevice::OnTimer(UINT_PTR nIDEvent)
{
If(nODEvent == 1)
{
KillTimer(1);
If(CPC_handle == -1)
{
InitCPC(7,this);
}
If(firstPass)
{
GetVersion();
}
SetTimer(1,10000,NULL);
}
}
Any ideas? I've run through about everything I can think of for debugging besides submitting a help ticket directly to Microsoft asking for assistance.
If there is any other information I can provide please let me know.
Edit
I forgot to mention "solutions" that I have found.
Initialization if the class object as a pointer
CDevice* device = new CDevice();
A random development version which only difference is a new dialog item. (No longer crashes with this version)
Setting the timer up in InitDialog method after 20ms sleep.
Initializing two CPC msg structures in constructor.
These all individually "resolve" the issue but I cannot seem to find any patterns between these "solutions" and I can't sell them as a solution with the reason of "because it seems to fix it".
I am in the process of trying to upgrade a VC++ 6.0 project to the latest version and am running into an issue. The program starts up fine but in the process of creating two child windows within the main view it crashes with an access violation. When run in debug mode it cannot find the exact location where the error occurs, displaying "Frame not in module" and "The current stack frame was not found in a loaded module. Source cannot be shown for this location" making it difficult to pinpoint the exact issue.
Going through the program step by step reveals that the error lies in the call of
CFrameWnd::InitialUpdateFrame.
From there it goes into the following functions:
Main.cpp:
frame->InitialUpdateFrame(dc, TRUE);
winfrm.cpp:
SendMessageToDescendants(WM_INITIALUPDATE, 0, 0, TRUE, TRUE);
afxwin2.inl:
CWnd::SendMessageToDescendants(m_hWnd, message, wParam, lParam, bDeep, bOnlyPerm);
wincore.cpp:
SendMessageToDescendants(hWndChild, message, wParam, lParam, bDeep, bOnlyPerm);
(Recursion to same function, error occurs on second recursion)
wincore.cpp:
AfxCallWndProc(pWnd, pWnd->m_hWnd, message, wParam, lParam);
Error has occurred at 3 of the following locations:
wincore.cpp:
_AfxPreInitDialog(pWnd, &rectOld, &dwStyle);
lResult = pWnd->WindowProc(nMsg, wParam, lParam);
_AfxPostInitDialog(pWnd, rectOld, dwStyle);
It is called from this function (simplified):
CDocument* XApp::OpenDocumentFile(LPCTSTR lpszFileName)
{
doc_x_spc *dc =
static_cast<doc_x_spc *> ( m_spc_template->CreateNewDocument() );
CMDIChildWnd *frame =
static_cast<CMDIChildWnd *> ( m_spc_template->CreateNewFrame(dc, NULL) );
if ( !dc->OnOpenDocument(lpszFileName) )
{
AfxMessageBox( IDS_SPCOPENERROR, MB_OK, NULL );
return NULL;
}
CString raw(lpszFileName);
dc->set_raw_file(raw);
frame->InitialUpdateFrame(dc, TRUE);
if (app_multiplexed == SINGLE)
menu.LoadMenu(IDR_REMPLETYPE_SINGLE);
else
menu.LoadMenu(IDR_REMPLETYPE);
CMainFrame* pMainFrame = (CMainFrame *)m_pMainWnd;
pMainFrame->MDISetMenu(&menu, NULL);
return dc;
}
The access violation produces this exact error:
Exception thrown at 0x01144008 in X.exe: 0xC0000005: Access violation executing location 0x01144008.
Would appreciate any help. Thank you!
I have a mfc Application an a extension dll with a modal Dialog. In this Dialog is a PropertySheet. One of the Property-Pages is loaded from a extnsion dll. Into the Extension DLL is an other property sheet. If I want to open a AfxMessageBox into the poperty sheet of the dll the application hang.
I think there is an deadlock.
The OS is Windows 7.
IDE Visual-Studio 2012
Here are some lines of the CallStack.
> mfc110d.dll!_AfxTraceMsg(const char * lpszPrefix, const tagMSG * pMsg) Zeile 302 C++
mfc110d.dll!AfxCallWndProc(CWnd * pWnd, HWND__ * hWnd, unsigned int nMsg, unsigned int wParam, long lParam) Zeile 275 C++
mfc110d.dll!AfxWndProc(HWND__ * hWnd, unsigned int nMsg, unsigned int wParam, long lParam) Zeile 453 C++
mfc110d.dll!AfxWndProcBase(HWND__ * hWnd, unsigned int nMsg, unsigned int wParam, long lParam) Zeile 304 C++
user32.dll!76a362fa() Unnamed
[The frames below are possible corrupted or not here. No symbols loaded foruser32.dll]
user32.dll!76a36d3a() Unknown
user32.dll!76a36ce9() Unknown
user32.dll!76a3966e() Unknown
user32.dll!76a396d5() Unknown
user32.dll!76a6104b() Unknown
user32.dll!76a60d62() Unknown
user32.dll!76a61089() Unknown
ntdll.dll!76f91171() Unknown
user32.dll!76a362fa() Unknown
ntdll.dll!76f91171() Unknown
ntdll.dll!76f91171() Unknown
ntdll.dll!76f91171() Unknown
ntdll.dll!76f91171() Unknown
user32.dll!76a36ce9() Unknown
user32.dll!76a40d37() Unknown
ntdll.dll!76f91171() Unknown
ntdll.dll!76f91171() Unknown
ntdll.dll!76f91171() Unknown
mfc110d.dll!CWnd::DefWindowProcA(unsigned int nMsg, unsigned int wParam, long lParam) Line 1141 C++
mfc110d.dll!CWnd::Default() Line 323 C++
mfc110d.dll!CWnd::OnActivate(unsigned int __formal, CWnd * __formal, int __formal) Line 368 C++
mfc110d.dll!CMFCPropertyPage::OnActivate(unsigned int nState, CWnd * pWndOther, int bMinimized) Line 73 C++
mfc110d.dll!CWnd::OnWndMsg(unsigned int message, unsigned int wParam, long lParam, long * pResult) Line 2540 C++
mfc110d.dll!CWnd::WindowProc(unsigned int message, unsigned int wParam, long lParam) Line 2137 C++
mfc110d.dll!AfxCallWndProc(CWnd * pWnd, HWND__ * hWnd, unsigned int nMsg, unsigned int wParam, long lParam) Line 290 C++
mfc110d.dll!AfxWndProc(HWND__ * hWnd, unsigned int nMsg, unsigned int wParam, long lParam) Line 453 C++
mfc110d.dll!AfxWndProcBase(HWND__ * hWnd, unsigned int nMsg, unsigned int wParam, long lParam) Line 304 C++
user32.dll!76a362fa() Unknown
user32.dll!76a36d3a() Unknown
user32.dll!76a36ce9() Unknown
comctl32.dll!71f771cb() Unknown
comctl32.dll!71f33770() Unknown
mfc110d.dll!CMapPtrToPtr::HashKey(void * key) Zeile 42 C++
mfc110d.dll!CMapPtrToPtr::GetValueAt(void * key) Zeile 180 C++
0058ca3c() Unbekannt
user32.dll!76a362fa() Unknown
user32.dll!76a5f963() Unknown
user32.dll!76a5f91b() Unknown
user32.dll!76a5f7a4() Unknown
ntdll.dll!76f91171() Unknown
user32.dll!76a362fa() Unknown
ntdll.dll!76f91171() Unknown
ntdll.dll!76f91171() Unknown
ntdll.dll!76f91171() Unknown
ntdll.dll!76f91171() Unknown
user32.dll!76a36ce9() Unknown
user32.dll!76a40d37() Unknown
ntdll.dll!76f91171() Unknown
ntdll.dll!76f91171() Unknown
ntdll.dll!76f91171() Unknown
mfc110d.dll!CWnd::DefWindowProcA(unsigned int nMsg, unsigned int wParam, long lParam) Zeile 1141 C++
mfc110d.dll!CWnd::WindowProc(unsigned int message, unsigned int wParam, long lParam) Zeile 2138 C++
mfc110d.dll!AfxCallWndProc(CWnd * pWnd, HWND__ * hWnd, unsigned int nMsg, unsigned int wParam, long lParam) Zeile 290 C++
mfc110d.dll!AfxWndProc(HWND__ * hWnd, unsigned int nMsg, unsigned int wParam, long lParam) Zeile 453 C++
mfc110d.dll!AfxWndProcBase(HWND__ * hWnd, unsigned int nMsg, unsigned int wParam, long lParam) Zeile 304 C++
user32.dll!76a362fa() Unknown
user32.dll!76a36d3a() Unknown
user32.dll!76a36ce9() Unknown
user32.dll!76a36ded() Unknown
user32.dll!76a36e4c() Unknown
ntdll.dll!76f3011a() Unknown
user32.dll!76a4219a() Unknown
user32.dll!76a8ef0a() Unknown
user32.dll!76a362fa() Unknown
user32.dll!76a5f9ff() Unknown
user32.dll!76a5f91b() Unknown
user32.dll!76a5f7a4() Unknown
user32.dll!76a4afbc() Unknown
user32.dll!76a362fa() Unknown
user32.dll!76a36d3a() Unknown
user32.dll!76a36ce9() Unknown
user32.dll!76a40d37() Unknown
user32.dll!76a4795a() Unknown
mfc110d.dll!_AfxActivationWndProc(HWND__ * hWnd, unsigned int nMsg, unsigned int wParam, long lParam) Zeile 489 C++
user32.dll!76a362fa() Unknown
user32.dll!76a36d3a() Unknown
user32.dll!76a36ce9() Unknown
user32.dll!76a3966e() Unknown
user32.dll!76a6208f() Unknown
user32.dll!76a5cf5b() Unknown
user32.dll!76a8f808() Unknown
user32.dll!76a8fae4() Unknown
user32.dll!76a8fbe7() Unknown
user32.dll!76a8fc66() Unknown
user32.dll!76a8fdb9() Unknown
user32.dll!76a8fdfe() Unknown
mfc110d.dll!CWinApp::ShowAppMessageBox(CWinApp * pApp, const char * lpszPrompt, unsigned int nType, unsigned int nIDPrompt) Zeile 128 C++
mfc110d.dll!CWinApp::DoMessageBox(const char * lpszPrompt, unsigned int nType, unsigned int nIDPrompt) Zeile 45 C++
mfc110d.dll!AfxMessageBox(const char * lpszText, unsigned int nType, unsigned int nIDHelp) Zeile 147 C++
Here is some Code from the DLL. CPropStkList is derived from CPropertyPage.
void CPropStkList::OnBnClicked()
{
//BOOL test = TryEnterCriticalSection(AfxGetThread());
AfxMessageBox(_T("Hallo Test!!"));
//CDialog dlg(IDD_DIALOG2);
//dlg.DoModal();
}
And here is the Code of the Parent-Application where calls the DLL-Dialog.
typedef UINT ( * LPDLLFUNC)(CGlobal *, CMsgSocket *); //Initialize DLL
typedef CProSeSDialog * ( * GETDLG)(CWnd*, UINT, CString); //Open Dialog from DLL
LPDLLFUNC lpfnDllFunc = NULL;
GETDLG getDlg = NULL;
HINSTANCE hDLL = NULL;
hDLL = AfxLoadLibrary("Stammdaten_DLL.dll");
if(hDLL)
{
lpfnDllFunc = (LPDLLFUNC)::GetProcAddress(hDLL,"Init");
getDlg = (GETDLG)::GetProcAddress(hDLL, "ShowDlg");
if (!lpfnDllFunc)
{
AfxMessageBox("Function not found in DLL");
FreeLibrary(hDLL);
//return;
}
if(!getDlg)
{
AfxMessageBox("Function getDlg not found in DLL");
FreeLibrary(hDLL);
}
lpfnDllFunc(AfxGetGlobal(), AfxGetGlobalSocket()); //Initialize DLL
dlg[i=GetNewDlgNr()] = getDlg(this, 1, _T(""));
m_strText[i] = INTLTXT ("Werkzeugstammdaten") + " DLL";
}
else
{
AfxMessageBox("Dll not found!");
}
Creation of the Dialog into the DLL
extern "C" AFX_EXT_API CProSeSDialog* ShowDlg(CWnd *parent, UINT dlgType = 0, CString strKey = _T(""))
{
new CDynLinkLibrary(Stammdaten_DLLDLL);
//Lege Einstiegsdaten fest
CGlobalKeyBuffer &buffer = CGlobalKeyBuffer::Instance();
buffer.m_strKey = strKey;
CViewDlg *test = new CViewDlg(WKZSTAMM);
test->Create(IDD_DIALOG1, parent);
return test;
}
UPDATE
After hours of debugging the Application i founnd that the Applicaion Sends some Messages. It never ends with sending messages.
Here are the sended Messages.
<025111> 001F1316 S WM_GETDLGCODE
<025112> 001F1316 R WM_GETDLGCODE fuDlgCode:DLGC_WANTARROWS | DLGC_HASSETSEL | DLGC_WANTCHARS
<025113> 001F1314 S WM_GETDLGCODE
<025114> 001F1314 R WM_GETDLGCODE fuDlgCode:DLGC_WANTARROWS | DLGC_HASSETSEL | DLGC_WANTCHARS
<025115> 00201312 S WM_GETDLGCODE
<025116> 00201312 R WM_GETDLGCODE fuDlgCode:DLGC_WANTARROWS | DLGC_WANTCHARS
<025117> 001E130C S WM_GETDLGCODE
<025118> 001E130C R WM_GETDLGCODE fuDlgCode:DLGC_WANTARROWS | DLGC_WANTCHARS
<025119> 001F1308 S WM_GETDLGCODE
<025120> 001F1308 R WM_GETDLGCODE fuDlgCode:DLGC_STATIC
<025121> 001F1306 S WM_GETDLGCODE
<025122> 001F1306 R WM_GETDLGCODE fuDlgCode:DLGC_STATIC
<025123> 001E1304 S WM_GETDLGCODE
<025124> 001E1304 R WM_GETDLGCODE fuDlgCode:DLGC_STATIC
<025125> 001F1302 S WM_GETDLGCODE
<025126> 001F1302 R WM_GETDLGCODE fuDlgCode:DLGC_STATIC
<025127> 00211300 S WM_GETDLGCODE
<025128> 00211300 R WM_GETDLGCODE fuDlgCode:DLGC_STATIC
<025129> 001E12FE S WM_GETDLGCODE
<025130> 001E12FE R WM_GETDLGCODE fuDlgCode:DLGC_STATIC
<025131> 001E12FC S WM_GETDLGCODE
I found a solution fo my problem.
You have to add to every element (control) that has any children the extern style
WS_EX_CONTROLPARENT.
ModifyStyleEx(0, WS_EX_CONTROLPARENT);
If that doesn't work you have to many subchildren. More than three is very difficult in MFC.
I have a function with this header
void LiveviewDlg::OnSize(UINT nType, int cx, int cy)
In this function I calculate some coordinates for my controls. I use for this
CRect rect;
GetWindowRect(&rect);
to get some values from my MFC control. After the line
GetDlgItem(IDSTART)->MoveWindow(dialogWidth - 120, 0, 100, 50);
I get the exception
Unhandled exception at 0x5DBA4F14 (mfc120ud.dll) in Liveview.exe: 0xC000041D: Exception while user callback (translated from german to english)
On my Windows 7 system my program works fine. On my windows 10 system I get the exception. I don't know, why is this exception thrown.