Sign in to follow this  

c++ mfc and cdialog

Recommended Posts

Hy. I wold create an application mfc with a dialog or a picturebox that display a directx11 scene. Now I have a simple application that create an hwnd of directx11 and a function that draw all the object on the screen with shaders , vertex and indexbuffer. How i can create a simple mfc dialog with mfc controls and an directx11 area that display the scene in the dialog? Thanks.

Share this post

Link to post
Share on other sites

I use mfc with dx9, maybe that can help you somewhat:

I create an mfc app (any kind will do, view/doc, dialog, etc...) and then create an extra cwnd with the parent set to the cwnd of the app window:

screenwnd.CreateEx(parent, x, y, cx, cy);

and then create the dx device with the wnd handle of the created cwnd:

d3d->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, screenwnd.m_hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &d3dpp, &d3ddevice );

and then when I do:

d3ddevice->Present(&visiblerc, NULL, NULL, NULL);

I see the rendered screen.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this