Inconsistentcies Between Win32 and MFC
-
Hi The Win32 OWNERDRAWITEM is handled by WS_DRAWITEM in the form of wParam lParam message While framework virtual function CStatic::DrawItem takes a LPDRAWITEMSTRUCT for a parameter Am I missing something ?
That seems right, that kind of thing is common in MFC. In this case the lParam would need to be cast to a LPDRAWITEMSTRUCT. In MFC you don't need the cast, it's actually pretty similar.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment "Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst "I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
-
That seems right, that kind of thing is common in MFC. In this case the lParam would need to be cast to a LPDRAWITEMSTRUCT. In MFC you don't need the cast, it's actually pretty similar.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment "Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst "I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
-
Doi need a message map entry to get my CStatic::DrawItem to be called I have SS_OWNERDRAW but it is not being called
Are WS_VISIBLE and WS_CHILD styles set?
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment "Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst "I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
-
Are WS_VISIBLE and WS_CHILD styles set?
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment "Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst "I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
-
Yes, I believe so.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment "Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst "I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
-
Yes, I believe so.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment "Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst "I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
-
Doi need a message map entry to get my CStatic::DrawItem to be called I have SS_OWNERDRAW but it is not being called
How did you set SS_OWNERDRAW if you did it by PreSubclassWindow in MFC there is a big gotcha with Static Text.
ModifyStyle(0, SS_OWNERDRAW); // WRONG for Static text ... won't work
ModifyStyle(SS_TYPEMASK, SS_OWNERDRAW); // CorrectIf you look at the bit field assignments you will see why you have to mask because unlike buttons with SS_OWNERDRAW there is overlap in bits between SS_RIGHT of static text and SS_OWNERDRAW.
In vino veritas
-
How did you set SS_OWNERDRAW if you did it by PreSubclassWindow in MFC there is a big gotcha with Static Text.
ModifyStyle(0, SS_OWNERDRAW); // WRONG for Static text ... won't work
ModifyStyle(SS_TYPEMASK, SS_OWNERDRAW); // CorrectIf you look at the bit field assignments you will see why you have to mask because unlike buttons with SS_OWNERDRAW there is overlap in bits between SS_RIGHT of static text and SS_OWNERDRAW.
In vino veritas