Solved

ActiveX question.

Posted on 2004-09-20
4
240 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thank you for an advice. The problem was in WS_CLIPCHILDREN. Now everything is fine.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.

772 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

12 Experts available now in Live!

Get 1:1 Help Now