1
votes

I have written this program, but when I minimize the window, all the drawing will be cleared. what should I do?

        CClientDC dc(this);
        dc.Ellipse(point.x-20,point.y-20,point.x+20,point.y+20);
        c[n][1] = point.x; c[n][2] = point.y;

who can help me solving this problem?

thanks alot

2

2 Answers

2
votes

Presumably you mean when you restore after having minimized the window.

Normally, in MFC you should do your drawing in the view's OnDraw member function (so you almost never need to use CClientDC as you have). Anything else that wants something drawn will put data describing what needs to be drawn into the Document object, and then call UpdateAllViews to get the new data drawn.

0
votes

Make a function of your above code and call it from OnDraw function. It will work fine.