hi , Thats great as what you said. The problem was in creating the dc. The code was
void CThreadDemoView::OnMenuOffline()
{
// TODO: Add your command handler code here
CClientDC dc(this);
CreateThreadsToPlot(pDC, CPoint(100,100) );
}
CreateThreadsToPlot will create the required no of threads to plot the points. After seeing your reply i tried this as a last attempt before giving it up. I went and browsed into the gdi code and found that my dc was not null. but surprisingly i think its invalid. This could be probably one of the reason i might have got the assertion. The code change was
void CThreadDemoView::OnMenuOffline()
{
// TODO: Add your command handler code here
CDC* pDC =GetDC();//code changed here only
CreateThreadsToPlot((CDC*)pDC, CPoint(100,100) );
}
This way of getting the DC has fixed the same issue without changing not even a single line of code in the program. Thank you very much Mr. Mark Salsbery. By, Manu