MFC中,使用对话框中弹出的对话框无法控制原对话框的picture control绘图
我在弹出的对话框的类中添加了如下代码,但是不能控制绘图,请教为什么
if (nResponse == IDOK) // 判断返回值是否为OK按钮(其ID为IDOK,鸡啄米已经将它删除)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL) // 判断返回值是否为Cancel按钮(其ID为IDCANCEL,鸡啄米将它的Caption改为了“退出”)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}
else
{
CWnd* pPictureWnd = GetDlgItem(IDC_PICTRUE1);
CDC *pDC = GetDlgItem(IDC_PICTRUE1)->GetDC();
CRect rc;
GetDlgItem(IDC_PICTRUE1)->GetClientRect(rc);
pDC->MoveTo( 10, 10);
pDC->LineTo( 100, 10);
pDC->MoveTo( 10, 10);
pDC->LineTo( 10, 100);
pPictureWnd->ReleaseDC(pDC);
}