{"id":3585,"date":"2014-03-29T02:03:25","date_gmt":"2014-03-29T02:03:25","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/29\/wpf-mfc-mdi-interop-crash-when-maximizing-child-frame-of-hosted-mdi-child-window-collection-of-common-programming-errors\/"},"modified":"2014-03-29T02:03:25","modified_gmt":"2014-03-29T02:03:25","slug":"wpf-mfc-mdi-interop-crash-when-maximizing-child-frame-of-hosted-mdi-child-window-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/29\/wpf-mfc-mdi-interop-crash-when-maximizing-child-frame-of-hosted-mdi-child-window-collection-of-common-programming-errors\/","title":{"rendered":"WPF\/MFC MDI interop &#8211; Crash when maximizing child frame of hosted MDI child window-Collection of common programming errors"},"content":{"rendered":"<p>I have an MFC MDI frame (CMDIFrameWnd-derived) that I am hosting inside a WPF shell application. CMainFrame uses the WM_CHILD style (I&#8217;ve unset the WM_CAPTION and FWS_ADDTOTITLE flags) and is parented to the WPF HwndHost.<\/p>\n<p>Everything looks OK except that when I maximize a child frame I usually get an access violation somewhere around the child frame window&#8217;s CWnd::OnMDIActivate() method.<\/p>\n<p>I assume the problem has to do with the CMainFrame no longer having a menu or caption or something.<\/p>\n<p>My questions are really:<\/p>\n<ol>\n<li>Why might it be crashing? Is there a &#8216;correct&#8217; way of making an MFC MDI app a child window?<\/li>\n<li>I can&#8217;t find much in the way of examples for my situation &#8211; has anyone else out there had experience WPF hosting an MFC MDI CMDIFrameWnd?<\/li>\n<\/ol>\n<p>Thanks for any help<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have an MFC MDI frame (CMDIFrameWnd-derived) that I am hosting inside a WPF shell application. CMainFrame uses the WM_CHILD style (I&#8217;ve unset the WM_CAPTION and FWS_ADDTOTITLE flags) and is parented to the WPF HwndHost. Everything looks OK except that when I maximize a child frame I usually get an access violation somewhere around the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3585","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3585","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3585"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3585\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3585"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3585"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3585"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}