Solved

ActiveX question.

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Getting IP address 8 89
ASP.net build a IF/Then Walkthrough Guide 1 236
Should CArray be used for a list of pointers in C++? 19 118
One named event, multiple event handlers 2 24
Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
  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 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.

860 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