I'm using VC++ 6, in my application there are a main dialog and three nomodal dialogs , the thing is this: in the main dialog there is a function 'drawLine' that draws lines in the client area of the main dialog , and it works fine, BUT when one of these nomodal dialogs is active and calls to the funtion 'drawLine' , the lines aren't drawn in the client area , are drawn in the desktop area. So , how can i do to call to this function 'drawLine' from one of these nomodal dialogs and that lines are drawn in the client area of main dialog?
this is the first part of code for my function 'drawLines':

void CCalibracionDlg:rawLines(int Rx,unsigned char D_Ry, unsigned char Vref)
{
// Rx en Kohm
CClientDC pDC(this) ; . . . . . and then i use pDC.SetPixel to draw lines. . .

I think that the solution is to use CClientDC pDC properly but i don't know how.