|So what you intend to do is (correct if I'm wrong):
When user double clicks the left mouse button, draw some graphics and make it permanent.
If I guessed well then you have to:
- Properly erase the background (see [^]).
- Make your painting function (i.e.
ShowIt() ) accepting as argument, a
CPaintDC instead of creating its own device context.
- Never call directly your paint function (or other drawing code, use instead
UpdateWindow to force the painting happen).
- inside the button handler just set a flag (a member variable of the class) and use it to conditionally call your painting function inside
void Ccom_testView::OnLButtonDblClk(UINT nFlags, CPoint point)
void Ccom_testView::ShowIt(CPaintDC & dc)
Hope it eventually makes sense.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke