I am developing a Ms Paint like application in MFC ,but I am having problem like i am not able to retain the drawn shape,as the window is getting repainted after invalidate is getting called,
Please help me as I am kind a beginner in MFC .
Look at the scribble sample project provided by microsoft.
Of course, it happens. You must record actions and re-draw on WM_PAINT (OnPaint in MFC)
If the painting actions are complex & cannot be recorded (like hand drawn shapes instead of lines, rectangles etc) You may draw into an offscreen memory DC (CDC::CreateCompatibleDC in MFC - imagine that as a bitmap) and draw it there. Later you can draw from that DC to screen using CDC->BitBlt on OnPaint
I'm not an MFC wizard, i'm used to the API. I suggest you go thru the msdn for more info on the classes
Store the points in a structure then using the points draw the shapes in OnPaint.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)