I have two CDialog classes that I have created. Let's call them MainDialog and ExtraDialog. I want ExtraDialog to be able to be displayed both through doModal and as a nested dialog within MainDialog.
I can already bring it up separately through a Button and doModal. However, I've been stuck about how to place it within MainDialog.
CWnd* m_pWndStatic = new CWnd;
m_pWndStatic->Create(_T("Something"), _T("Title"), WS_CHILD | WS_VISIBLE, CRect(x, y, xEnd, yEnd), this, idWnd);
CExtraDialog* dlg = new CExtraDialog;
dlg->Create(IDD_NEW_DIALOG, this); //Or second variable can be m_pWndStatic?
//dlg->SetWindowPos(m_pWndStatic, x, y, xEnd, yEnd, SWP_NOZORDER | SWP_NOACTIVATE);
//dlg->Invalidate();
//dlg->ShowWindow(SW_SHOW);
//m_pWndStatic->ShowWindow(SW_SHOW);
Above I shared some of the thigns I have tried. I was hoping to create a CWnd and put the dialog inside the CWnd but I feel like I am missing something and I couldn't really find anything helpful online.
Edit: I am basically trying to put multiple CWnds into one CDialog, and having the CWnd's run different functionalities from different classes. Kinda like putting lego blocks together.
Edit2: I found a question that is kinda similar? I hope to make it similar but I just don't want buttons and I want two of them get displayed at once. Embedding dialogs in main dialog and switching them with button click in MFC