Click here to Skip to main content
15,884,848 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hey Folks,

I'm facing an annoying problem that drives me nuts.

On my CView-derived view I placed an ActiveX Control that consists of some buttons - nothing fancy or special. At the beginning it is shown correctly but after the OnUpdate()-method of the view the Control is not shown anymore - it's just a white plane. When I now resize the view the control is painted again correctly. Also when I click somewhere on the white plane the control's button underneath my cursor is then shown again - the others remain white.

I tried already to Invalidate() the control with no success.

Any hints or tips?
Posted
Comments
Albert Holguin 25-Feb-14 13:16pm    
What kind of control is it?
DFaeuster 26-Feb-14 1:29am    
It's a self written ActiveX Control similar to a toolbar (some buttons etc.)
But I've found a solution for my redrawing problem in the meanwhile by calling "RedrawWindow()"

1 solution

This *usually* means the containing window is processing the WM_ERASEBKGND windows message. If the Active-X control draws it's own background - having the containing window do this is a waste and also causes flicker. Override this message to return a non-zero value (eg. 1) to suppress this behavior.

http://msdn.microsoft.com/en-us/library/windows/desktop/ms648055%28v=vs.85%29.aspx[^]

Another thing to check is the containing window's style. The containing window should have the WS_CLIPCHILDREN style set so that it doesn't draw / erase its child windows.

http://msdn.microsoft.com/en-us/library/windows/desktop/ms632600%28v=vs.85%29.aspx[^]
 
Share this answer
 
v2
Comments
DFaeuster 24-Feb-14 9:18am    
Sorry for the late response but was stuck in another project.
I tried both of your hints but none of them helped me to solve the problem.
But thanks for your time.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900