the key point to do this without using bitmap is cdc->SetROP2(R2_NOT). and you should record the point for the last drawing. I try to test it by the following steps, hope is will help
define CPoint m_lastPoint in C**view
Initilize m_lastPoint = CPoint(-100,-100) in C**view construct function
add OnMouseMove function for the message WM_MOUSEMOVE or other message you want to add.
CDC *cdc; cdc = GetDC();
CPoint mMousePoint = point; CRect rectRange;//(0,0,500,500); GetClientRect(&rectRange); if(m_lastPoint.x >= 0 && m_lastPoint.y >= 0) { cdc->SetROP2(R2_NOT); mMousePoint = m_lastPoint; cdc->MoveTo(rectRange.left,mMousePoint.y); cdc->LineTo(mMousePoint.x - 1,mMousePoint.y); cdc->MoveTo(mMousePoint.x + 1,mMousePoint.y); cdc->LineTo(rectRange.right,mMousePoint.y); cdc->MoveTo(mMousePoint.x,rectRange.top); cdc->LineTo(mMousePoint.x,mMousePoint.y - 1); cdc->MoveTo(mMousePoint.x,mMousePoint.y + 1); cdc->LineTo(mMousePoint.x,rectRange.bottom); } cdc->SetROP2(R2_BLACK); mMousePoint=point; cdc->MoveTo(rectRange.left,mMousePoint.y); cdc->LineTo(mMousePoint.x - 1,mMousePoint.y); cdc->MoveTo(mMousePoint.x + 1,mMousePoint.y); cdc->LineTo(rectRange.right,mMousePoint.y); cdc->MoveTo(mMousePoint.x,rectRange.top); cdc->LineTo(mMousePoint.x,mMousePoint.y - 1); cdc->MoveTo(mMousePoint.x,mMousePoint.y + 1); cdc->LineTo(mMousePoint.x,rectRange.bottom); m_lastPoint = mMousePoint;