Hi.

I am using AppWizard single-document type setup. I need to get the rectange of the ChildView. All I am trying to do is change the background color of the ChildView. So ineed to get the exact size and location of the ChildView related to the MainFrame. I tried using this:

-----
CWnd *pWnd = AfxGetMainWnd();
CRect rectCView;
pWnd->get(rectCView);
CBrush *pOldBrush, newBrush(RGB(0, 0, 0));
CDC *pDC = pWnd->GetDC();
pOldBrush = pDC->SelectObject(&newBrush);
pDC->Rectangle(rectCView);
pDC->SelectObject(pOldBrush);
pWnd->ReleaseDC(pDC);
-----

The problem with the code segment above is that it repaint everything inside the MainFrame including the toolbar and statusbar. I would like it to paint the ChildView.

Thanks,
Kuphryn