I have a picturebox control with OwnerDraw set to true.

In the CDialog1 class I wrote code to draw onto it in the function

Code:
void CDialog1 ::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)
{

   if(lpDrawItemStruct->itemID = IDC_PICBOX)
	{
                //drawcode...
      

        }

CDialogEx::OnDrawItem(nIDCtl, lpDrawItemStruct);
}

I tried to create a class CPicBox derived from CStatic and to subclass
Code:
void CPicBox ::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)
{
	CStatic::OnDrawItem(nIDCtl, lpDrawItemStruct);
}

but in DEBUG mode I keep getting the assertion failure on winctrl1.cpp at line 39 alias "OnDrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) is not overloaded and the virtual base function is called where ASSERT(FALSE); is located"


Can someone help me please?