Click to See Complete Forum and Search --> : Repaint problem in IE


Hulkin
August 23rd, 1999, 04:59 AM
The active X control which I am using only display an WMF-File. When the scroll bars are used, the active X control is not repainted properly and close grey and black horizontal lines appear. This problem occurs only while using IE 5.0 as the browser and does not occur while using IE 4.0 as the browser or ActiveX test container. Is this problem because of IE 5.0?? Or is there a way to solve this problem???

with regards
Stefan

Tom Lee
August 25th, 1999, 08:33 AM
I have had simular problems, and have found that for COleControls that you have to overide the following:

DWORD CMyControl::GetControlFlags()
{
return COleControl::GetControlFlags() & ~(clipPaintDC | fastBeginPaint);
}

This is a documented BUG for VC 4.1 , 4.2, 5.0.

Hulkin
August 25th, 1999, 08:39 AM
I have solved it too. there is an documented bug in IE To solve it you must override an OnPaint method like this:

CPaintDC dc(this); // device context for painting
int cliprgnrect;
CRect rcClientRgn;
HRGN hrgnClipOut;

GetOuterWindow()->GetClientRect(&rcClientRgn);
hrgnClipOut = ::CreateRectRgn( rcClientRgn.left, rcClientRgn.top,rcClientRgn.right,rcClientRgn.bottom);

cliprgnrect = ::SetWindowRgn(GetOuterWindow()->m_hWnd, hrgnClipOut, TRUE);
COleControl::OnPaint(&dc);

You can find it on MSDN Q233391

with regards