It works with VC6, but fails in a VC7 app using the same code.
The listbox control has "owner draw" and "has strings" set.
What more do I have to do to get the framework to call DrawItem() with VC7?
TIA
Jan
Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
lpCreateStruct->style |= LBS_OWNERDRAWFIXED|LBS_NOINTEGRALHEIGHT|LBS_NOTIFY;
For version <6,
The style was modified in the PreSubclassWindow(), using ModifyStyle like this:
ModifyStyle(0,LBS_OWNERDRAWFIXED|LBS_NOINTEGRALHEIGHT|LBS_NOTIFY);
So before this, we need to check comctl32 version with this call:
HRESULT hr = AtlGetCommCtrlVersion(&dwMajor, &dwMinor);
Hope it helps anybody for the future because I have seen no post in forums that explains this MFC issue.
>> Submitted via EggHeadCafe
>> Excel Generate High Quality RoadMaps
>> http://www.eggheadcafe.com/tutorials/aspnet/3310004f-e1ae-45a7-9bea-7b2b970d1230/excel-generate-high-quality-roadmaps.aspx
By the way, always put blank space around binary operators so the text is readable, e.g.,
never write "A|B", always write "A | B". Readability matters.
I would like to add this anomaly to my essay on MSDN Errors and Omissions. Let me know if
you will allow this (I will give you a credit line in the article). If you want a
citation to other than the name you are posting under, and don't want to put that name
here, you can send me private email telling me how you want the credit to read.
joe