Display one dialog image in another dialog Picture control
Hi All,
I have created a MFC Dialog based application and I have added a
picture control on it.
Now I have inserted another Dialog Resource from menu Insert ->
Resource -> Dialog-> New.
For the newly inserted Dialog, I have created a class
CFirstDialogPage. And I have added a picture control and added the
bitmap on the picture control.
Now I want show the Second dialog bitmap on the First Dialog Picture
control but I am unable to do that.
I have written the code like below in the First Dialog Ok button
void CTestingDlg::OnOK()
{
CRect rect;
CStepOnePage *pPage = new CStepOnePage();
if (pPage->Create(IDD_DIALOG1, this) == FALSE) ;
//IDD_DIALOG1 is the Newly created Dialog ID
CWnd *pWnd = GetDlgItem(IDC_SHEETRECT);
//IDC_SHEETRECT is the Picture control ID of the MainDialog(First
Application Dailog)
ASSERT(pWnd != NULL);
ASSERT(IsWindow(pWnd->m_hWnd) != FALSE);
pWnd->GetWindowRect(&rect);
pPage->ScreenToClient(&rect);
pPage->SetWindowPos(NULL, rect.left, rect.top, 0, 0,
SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE );
pPage->EnableWindow(TRUE);
pPage->ShowWindow(SW_SHOW);
pPage->InvalidateRect(NULL);
pPage->UpdateWindow();
//CDialog::OnOK();
}
But by this displaying the Second dialog but as individual
but i want to render the second dialog in the first Dialog but not as
a separate dialog (means Second dialog will be merged as a part of the
first dialog)
Thanks in advance.
Regards
Rasheed.