Reputation: 246
I need to use a WPF Lib with a System.Windows.Navigation.NavigationWindow in a MFC Win32 app but I have a black screen instead of my WPF Windows. I have no error message in the debug output.
All the other WPF control I tried work fine in MFC (button, grid, D3D with C++).
Anyone have an idea how to debug that or how to investigate that?
Thanks
EDIT: The problem happen with System.Windows::Window too. And it work fineif I use my WPF in a WPF App.
Upvotes: 2
Views: 338
Reputation: 246
I can't find a working solution but here's my workaround at the moment.
I created a separate a WPF app with my WPF Lib.
And in my MFC app I do:
HWND wpfProcessMainWnd = CreateProcessWPF();
SetParent(wpfProcessMainWnd, hWnd);
DWORD style = GetWindowLong(wpfProcessMainWnd, GWL_STYLE);
style |= WS_CHILD;
style &= ~(WS_BORDER | WS_OVERLAPPEDWINDOW);
SetWindowLong(wpfProcessMainWnd, GWL_STYLE, style);
SetWindowPos(wpfProcessMainWnd, NULL, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
From:
https://stackoverflow.com/a/16641537/2849700
Upvotes: 0