From: wxdeveloper on
Hello,

I have a following scenario to handle:
A CWnd derived class is a parent window for a number of child
controls. One of those controls is a descendant of CStatic.
The child control (CStatic derived) is created dynamically with
SS_OWNERDRAW style set and handles ON_WM_DRAWITEM_REFLECT.
The problem is that DrawItem of the child control is never called. I
also set break point in CWnd::OnDrawItem to see if it called at all
and I found out that it is not.
On the other hand if I put the control on CDialog everything works as
expected. I begin to think that bare CWnd does not fully handle
message reflection by itself ?

Thank you
J.
From: David Lowndes on
>I have a following scenario to handle:
>A CWnd derived class is a parent window for a number of child
>controls. One of those controls is a descendant of CStatic.
>The child control (CStatic derived) is created dynamically with
>SS_OWNERDRAW style set and handles ON_WM_DRAWITEM_REFLECT.
>The problem is that DrawItem of the child control is never called. I
>also set break point in CWnd::OnDrawItem to see if it called at all
>and I found out that it is not.
>On the other hand if I put the control on CDialog everything works as
>expected. I begin to think that bare CWnd does not fully handle
>message reflection by itself ?

It's not something I've ever needed to do, but from the documentation
(see "Handling Reflected Messages" on MSDN) I'd have expected it to
work. I think you may have to debug into it (your CWnd::OnChildNotify)
to see what's going on (or not in your case).

Dave
From: wxdeveloper on
> It's not something I've ever needed to do, but from the documentation
> (see "Handling Reflected Messages" on MSDN) I'd have expected it to
> work. I think you may have to debug into it (your CWnd::OnChildNotify)
> to see what's going on (or not in your case).
>
> Dave

Thank you for the hint.
I could not figure out why it does not work.
In the end I gave up and decided to use simple WM_PAINT to draw what I
need to draw.

Thank you
J.

From: Ajay Kalra on
On Mar 1, 11:02 pm, wxdeveloper <wxdevelo...(a)gmail.com> wrote:
> > It's not something I've ever needed to do, but from the documentation
> > (see "Handling Reflected Messages" on MSDN) I'd have expected it to
> > work. I think you may have to debug into it (your CWnd::OnChildNotify)
> > to see what's going on (or not in your case).
>
> > Dave
>
> Thank you for the hint.
> I could not figure out why it does not work.
> In the end I gave up and decided to use simple WM_PAINT to draw what I
> need to draw.
>

Just a guess, when you created CStatic, what ID did you use? Perhaps
use something other than the default (i think its -1). I dont know if
thats the reason but worth a shot.

--
Ajay

 | 
Pages: 1
Prev: type question
Next: Toolbar keyboard navigation