Solved

ActiveX question.

Posted on 2004-09-20
4
245 Views
Last Modified: 2008-01-09
I am developing some ActiveX components and I have some not fixed error: one component can be sizeable and I can fit it to the whole window and when I starts to resize the window - active X component blicks very hard. I thought, that window beside component redraw itself and this is cause of this blinking, but it's not true. Does someone have answer for this problem, or some advise?? I think that, ActiveX Container has it's own window that erase it self and this is the cause of blinking.
0
Comment
Question by:Neoliten
  • 2
  • 2
4 Comments
 
LVL 48

Expert Comment

by:AlexFM
ID: 12099954
Flickering is result of WM_PAINT and WM_ERASEBKGND messages handling. If WM_PAINT message handler draws all control including background, handle WM_ERASEBKGND message and return TRUE without calling of base class function.
WM_PAINT handler may be also optimized using memory device context.
Implementation depends on the way you are writing ActiveX control - ATL or MFC.
0
 

Author Comment

by:Neoliten
ID: 12099988
I am using MFC.

There are also some flags for ActiveX optimization, but it can't reduce blinking:
//      dwFlags |= noFlickerActivate;
//      dwFlags |= canOptimizeDraw;
//      dwFlags |= fastBeginPaint ;
//      dwFlags |= clipPaintDC  ;
      dwFlags |= windowlessActivate;      


I am currently handle this message by:

BOOL CACtrl::OnEraseBkgnd(CDC* pDC)
{
      return TRUE;
//      return COleControl::OnEraseBkgnd(pDC);
}

...
afx_msg BOOL OnEraseBkgnd(CDC* pDC);

No progress...

0
 
LVL 48

Accepted Solution

by:
AlexFM earned 300 total points
ID: 12100043
Does your control flicker in all containers or in some specific container? Flickering may be reduced by setting WS_CLIPCHILDREN style in the control's parent window.
Please show your WM_PAINT message handler. Possibly it can be optimized using memory DC.
0
 

Author Comment

by:Neoliten
ID: 12100052
Thank you for an advice. The problem was in WS_CLIPCHILDREN. Now everything is fine.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now