Click here to Skip to main content
16,018,158 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: attach a doc Pin
_AnsHUMAN_ 30-May-07 22:32
_AnsHUMAN_ 30-May-07 22:32 
QuestionRe: attach a doc Pin
David Crow31-May-07 4:58
David Crow31-May-07 4:58 
QuestionIs this called Buffre overrun Pin
vipin_nvk30-May-07 21:40
vipin_nvk30-May-07 21:40 
AnswerRe: Is this called Buffre overrun Pin
Cedric Moonen30-May-07 21:52
Cedric Moonen30-May-07 21:52 
AnswerRe: Is this called Buffre overrun Pin
Optimus Chaos30-May-07 22:01
Optimus Chaos30-May-07 22:01 
AnswerRe: Is this called Buffre overrun Pin
CPallini30-May-07 22:02
mveCPallini30-May-07 22:02 
AnswerRe: Is this called Buffre overrun Pin
Matthew Faithfull30-May-07 22:46
Matthew Faithfull30-May-07 22:46 
QuestionCListCtrl Pin
Steve14430-May-07 21:27
Steve14430-May-07 21:27 
I have used the CListCtrl example 'LVCustomDraw' to create a list control with colored columns. This works fine until I add an imagelist (BITMAP) to the list control.

My class is derived from the CListCtrl class, and I use two functions 'OnEraseBkgnd' and 'OnCustomDraw' to color the alternate columns.

The list control and imagelist are defined in the dialog class header

...
CListCtrlEx m_ctlList;
CImageList m_cImageListNormal, m_cImageListSmall, m_cImageListState;
...

and the bitmap is add in the dialog class

...
// Create 256 color image lists

HIMAGELIST hList = ImageList_Create(32,32, ILC_COLOR8 |ILC_MASK , 8, 1);
m_cImageListNormal.Attach(hList);

hList = ImageList_Create(16, 16, ILC_COLOR8 | ILC_MASK, 8, 1);
m_cImageListSmall.Attach(hList);

// Load the large icons

CBitmap cBmp;
cBmp.LoadBitmap(IDB_IMAGES_NORMAL);
m_cImageListNormal.Add(&cBmp, RGB(255, 0, 255)); //m_colRow1
cBmp.DeleteObject();

// Load the small icons

cBmp.LoadBitmap(IDB_IMAGES_SMALL);
m_cImageListSmall.Add(&cBmp, RGB(255,0,255));

// Attach them

m_ctlList.SetImageList(&m_cImageListNormal, LVSIL_NORMAL);
m_ctlList.SetImageList(&m_cImageListSmall, LVSIL_SMALL);
...

The columns and items are then added.

I assume the default color of the list control is white, and the image is transparent, but when the background is redrawn, the image is not being 'refreshed', and hence it appears to have a white background.

I have noticed another example on CodeProject that has a similar result when the image is added.


Thank you

Steve
AnswerRe: CListCtrl Pin
Naveen30-May-07 22:09
Naveen30-May-07 22:09 
GeneralRe: CListCtrl Pin
Steve14431-May-07 12:45
Steve14431-May-07 12:45 
GeneralRe: CListCtrl Pin
Naveen31-May-07 13:58
Naveen31-May-07 13:58 
GeneralRe: CListCtrl Pin
Steve14431-May-07 14:23
Steve14431-May-07 14:23 
GeneralRe: CListCtrl Pin
Naveen31-May-07 14:27
Naveen31-May-07 14:27 
GeneralRe: CListCtrl Pin
Steve14431-May-07 14:35
Steve14431-May-07 14:35 
QuestionBluetooth programming problem Pin
followait30-May-07 21:23
followait30-May-07 21:23 
AnswerRe: Bluetooth programming problem Pin
Roger Stoltz30-May-07 22:08
Roger Stoltz30-May-07 22:08 
QuestionCDlg on active (MFC) Pin
waxie30-May-07 21:21
waxie30-May-07 21:21 
AnswerRe: CDlg on active (MFC) Pin
Roger Stoltz30-May-07 21:53
Roger Stoltz30-May-07 21:53 
GeneralRe: CDlg on active (MFC) Pin
waxie30-May-07 21:58
waxie30-May-07 21:58 
GeneralRe: CDlg on active (MFC) Pin
Roger Stoltz30-May-07 22:02
Roger Stoltz30-May-07 22:02 
GeneralRe: CDlg on active (MFC) Pin
Roger Stoltz30-May-07 23:17
Roger Stoltz30-May-07 23:17 
GeneralRe: CDlg on active (MFC) Pin
waxie30-May-07 23:23
waxie30-May-07 23:23 
GeneralRe: CDlg on active (MFC) Pin
sps-itsec4630-May-07 23:41
sps-itsec4630-May-07 23:41 
GeneralRe: CDlg on active (MFC) Pin
waxie30-May-07 23:49
waxie30-May-07 23:49 
GeneralRe: CDlg on active (MFC) Pin
sps-itsec4631-May-07 0:20
sps-itsec4631-May-07 0:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.