I used the following code in my Paint program
In fact a good deal of it is from http://msdn.microsoft.com/library/de...ce_context.aspCode:switch (flag) { case 1: //drawing freehand CPen *penBlack,*newpen; // Construct it, then initialize if( newpen->CreatePen( PS_DOT, 2, RGB(255,0,0) ) ) { // Select it into the device context // Save the old pen at the same time penBlack = pDC->GetCurrentPen(); pDC->SelectObject( newpen ); if (nFlags && MK_LBUTTON) { pDC->MoveTo (OldPoint.x, OldPoint.y); pDC->LineTo (point.x,point.y); } // Restore the old pen to the device context pDC->SelectObject( penBlack ); } break;
But although it compiles fine, when i try to run it, it gives me the following error message
The instruction [-some number-] read memory address [0x....] which could not be read.
What does this mean ???