hi all..


i finished developing an application for drawing figures like
rectangle,circle and line..
its uses just OnDraw() and pDC..


Now i need to change the program so that it uses memory dc for drawing

the figures..
i need an urgent help for this... i tried doing it but i am not sure
of what i am doing..


these are the codes i tried plz give me idea hoew to go for this..


void CFinalView::OnDraw(CDC* pDC)
{ CDC dcmem;
//CDC dc;


CBitmap membmp;
dcmem.CreateCompatibleDC(pDC);
membmp.CreateCompatibleBitmap(pDC,100,100);
//CBitmap* pOldbmp = dcmem.SelectObject(&membmp);


CRect newrect(0, 0, m_length,m_width);
//dcmem.Rectangle(0,0,m_length,m_width);
//dcmem.FillRect(&newrect,&newBrush);
pDC->Rectangle(0, 0, m_length,m_width);
//pDC->FillRect(&newrect, &newBrush);
pDC->BitBlt(100,100,50,50,&dcmem,0,0,SRCCOPY);


dcmem.SelectObject(&newrect);


}


This code is not drawing in the view window....

Thanks for your help...