Resize into MFC Application


I’m trying to embed Panda3D into a MFC Application. I built a simple sdi mfc application with VS2019 and i can see some graphics into my application at startup but it has a fixed size. I have tried to set size into a virtual On size

void CMFCApplication1View::OnSize(UINT nType, int cx, int cy)
CView::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
#ifdef TST_PANDA
if (g_Panda && g_Panda->pWindow)
auto pWin = g_Panda->pWindow;
WindowProperties props = pWin->get_graphics_window()->get_properties();
props.set_origin(0, 0);
props.set_size(cx, cy);

But with this implementation, another window is created.

Do i make a mistake?