Problems with Drawing an MFC ActiveX control inside on ATL compsoite control 
Author Message
 Problems with Drawing an MFC ActiveX control inside on ATL compsoite control

Hello Everybody !!!

I'm working on  Windows NT platform on VC++6.
I have build an MFC control = "Flash control".
With the properties assigned to this control you can pick two colors
and the
control will be changing its color between them every  second.
(Flashing).

Now all this is based on the Fact that a timer Call every second the
InavlidateControl ()
function (I tried also InvalidateRect()) , and it shoud call the
OnDraw function.
Then in OnDraw function i call the FillRect function in order to paint
the color of the control.
I get the CDC (device context class) as a parameter.

I have put this control into a composite control , and then I tried
the composite control on an MFC
dialog.

It doesnt work.

1) The OnDraw is not being called in response to the Invalidatecontrol
() function, that is being called
    by the timer.

2) I tried replacing InvalidateControl()  with SendMessage(WM_PAINT)
and then
OnDraw() is being called its being called . but doesnt draw anything.

Anybody has any ideas ?



Wed, 12 Nov 2003 04:54:43 GMT  
 Problems with Drawing an MFC ActiveX control inside on ATL compsoite control
I don't know why it doesn't work.....

I develop an activex control and InvalidateControl() works well... (NT4 +
VC++6)

Are you sure you use the same CDC than the OnDraw method  (OnDraw(CDC,
CRect.....))

For FillRect, you can use the CRect object wich is in the OnDraw parameters
(rcBounds )...

your problem can became from the CBrus you use in the FillRect method...;
Try :
CBrush myBrush(myColor)  / / with COLORREF myColor
pdc->FillRect(rcBounds,&myBrush);

I hope it will help you ...

Vincent Fagard



Quote:
> Hello Everybody !!!

> I'm working on  Windows NT platform on VC++6.
> I have build an MFC control = "Flash control".
> With the properties assigned to this control you can pick two colors
> and the
> control will be changing its color between them every  second.
> (Flashing).

> Now all this is based on the Fact that a timer Call every second the
> InavlidateControl ()
> function (I tried also InvalidateRect()) , and it shoud call the
> OnDraw function.
> Then in OnDraw function i call the FillRect function in order to paint
> the color of the control.
> I get the CDC (device context class) as a parameter.

> I have put this control into a composite control , and then I tried
> the composite control on an MFC
> dialog.

> It doesnt work.

> 1) The OnDraw is not being called in response to the Invalidatecontrol
> () function, that is being called
>     by the timer.

> 2) I tried replacing InvalidateControl()  with SendMessage(WM_PAINT)
> and then
> OnDraw() is being called its being called . but doesnt draw anything.

> Anybody has any ideas ?



Fri, 14 Nov 2003 16:57:54 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Help - Problems with Drawing an MFC ActiveX control inside on ATL compsoite control

2. Problem using activex control inside ATL com dll

3. ActiveX control inside another activex control

4. ActiveX control inside another ActiveX control

5. ActiveX-control inside ActiveX-control

6. ATL ActiveX Control hosting code fails to initialize ActiveX Controls on Win9x

7. ActiveX Control inside ATL DLL

8. activex control inside atl dll - repost

9. ActiveX Control inside ATL.DLL Part II

10. ATL(+MFC) Composite control VS MFC ActiveX Contol

11. ATL ActiveX composite Control and drawing

12. Model MFC App inside ActiveX Control and ToopTips

 

 
Powered by phpBB® Forum Software