using pDC pointer in mfc/sdi in vc++

i m using pDC pointer in a recursive function........

here's my code...


void P_class::recursive_function(int tasks,CDC *& pDC)
{

CString str,str1,str2,str3,str4,str5,str6,str7,str8,str9,str10;


for(int j=0;j<p;j++)
{
if(tasks==0)
{


temp[tasks][j]=1;

for(int i=0;i<t;i++)
{
for(int j=0;j<p;j++)
{
if(temp[i][j]==1)
{
str3.Format("%i",dynamicArray[i][j],str3);
pDC->TextOut(x,y,str3);
x+=30;
}

else
{
str4.FormatMessage("-");
pDC->TextOut(x,y,str4);
x+=30;
}


}
y+=15;
x=30;

}

y+=15;

str4.FormatMessage("----------------");
pDC->TextOut(x,y,str4);

y+=25;

x=30;

// Invalidate(refresh);

for(int k=0;k<p;k++)
{
temp[tasks][k]=0;
}
}

else
{
temp[tasks][j]=1;
recursive_function(tasks-1,pDC);

for(int i=0;i<p;i++)
{
temp[tasks][i]=0;
}

}
}

}




the main thing in this code is only that the pDC pointer is used recursively...and it doesnot display values fine...it actually display some values...and when i scroll it down...there is nothing displayed and when i again scroll up...the data which was visible before..it agian gets invisible...i think this is bcoz i m using the pDC pointer recursively...kindly help me to solve this
Topic archived. No new replies allowed.