Solved

ActiveX question.

Posted on 2004-09-20
4
262 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
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 goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

685 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