The CDC (SetPixel) function cannot be accessible inside the member function of another class.
//OnPerformIBIT is a member function created by me
void CSplitterOne:: OnPerformIBIT()
{
CDC *myDC = GetDlgItem(IDC_PICBOX)->GetDC();
myDC->SetPixel(0, 0, RGB(0,0,0));
myDC->SetPixel(1, 1, RGB(0,0,0));
myDC->SetPixel(2, 2, RGB(0,0,0));
myDC->SetPixel(3, 3, RGB(0,0,0));
myDC->SetPixel(4, 4, RGB(0,0,0));
myDC->SetPixel(5, 5, RGB(0,0,0));
myDC->SetPixel(6, 6, RGB(0,0,0));
}
//In the above function is called from MainFrm.cpp. In the same function I cannot create the object for CDC. It give assertion. I am not get the Handle for Window (hWnd).
If I am do the same in thing in OnPaint() it works. Please Help me.
//CSplitterOne is FormView class.