
CImageList in a ATL Property page
Hi All,
I working on creating my own property pages for a 3rd
party ActiveX object and I'm having some problems with
custom controls on the property page. First off I'm
having problems creating a CImageList and having it load a
bitmap from the resources. I found the following work
around but it there a better and easier way of doing this.
CBitmap* pBM = CBitmap::FromHandle(::LoadBitmap
(_Module.GetModuleInstance(), MAKEINTRESOURCE
(IDB_BITMAP_STACKED)));
// m_imlSmall is my CImageList
m_imlSmall.Create(16,16,ILC_COLOR16, 0,4);
m_imlSmall.Add(pBM, RGB(255,0,255));
The other problem I'm having is with SubclassDlgItem. It
doesn't seem to quite work. I can subclass an item but
some of the messages don't seem to be routed to the
subclass. I end up having to catch the message in the
property page and then calling the subclass's function
directly. For example I try to subclass a CComboBox. I
set for owner draw but the subclass DrawItem never gets
called. I end up catching the message with a OnDrawItem
and call the method directly. Is that the way it has to
be done or is there a better way? Thanks for all your
help.
-Ben