直ってなかった

別の不具合(タブコントロールに貼り付けたときに再描画がおかしい)が再発。いまやっと完了した。

COleControl の場合は、UpdateWindow() & InvalidateRect(NULL)の代わりに、InvalidateControl()。これ定説、らしい。


The control's container owns the property the control is painting on. Therefore, the control should use COleControl::InvalidateControl to ask permission before drawing on the container.

When I first read the description of COleControl::InvalidateControl, it reminded me of CWnd::Invalidate and ::InvalidateRect. In a standard Windows-based application, these functions change only the invalidated rectangle --- the screen is not updated until the next WM_PAINT message. Therefore, if you need to update the client area, you must call UpdateWindow to get the WM_PAINT message on demand.

However, COleControl::InvalidateControl does not work the same way as ::InvalidateRect or CWnd::Invalidate. The only function you need to call is InvalidateControl --- not UpdateWindow.

あー、くたくた。