Direct3D and MFC/CView HWnd
I've got an SDI MFC application that initialises a Direct3D Device inside one of the View Classes.
CApp >> CMainFrame >> CView >> DirectX
I'm also using the basic View switching model(no splitter Wnd) taken straight from Microsofts' sample program - 'swsplit', it basically copies a few pointers, deletes the existing View and then creates a new one.
If i use the main windows HWND :
It works correctly all the time but the D3D device floats on top of the toolbars and statusbar, i guess because it's attached to the main window not the child window.
InitD3D( AfxGetApp()->m_pMainWnd->GetSafeHwnd() );
however, if i do it the way i want and use the CViews HWnd :
It will only work when the view class is created by the MFC framework at startup, as soon as i switch the view class and then switch back Direct3D fails to start and gives the error: 'Internal Driver Error'
InitD3D( GetSafeHwnd() );
Thanks in advance