Solved

ActiveX question.

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
  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 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 be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

786 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