Embedding a control in a CListView
Hi,
I'm trying to embed a CProgressCtrl (or a CStatic, or anything) into a column of a listview control. I basically want to display graphically what I have displayed numrically in the column beside it.
So far, I have:
bool frmProd::CreateProgress( int Index, int subIndex, int percent )
{
CProgressCtrl m_Prog;
CRect ItemRect;
CListCtrl *l_ctrl = ( CListCtrl* )GetDlgItem( IDC_PROD_VIEW );
l_ctrl->GetSubItemRect(Index, subIndex, LVIR_BOUNDS, ItemRect);
int left = ItemRect.left;
int top = ItemRect.top;
int right = ItemRect.right;
int bottom = ItemRect.bottom;
if( !m_Prog.Create(PBS_SMOOTH | WS_CHILD | WS_VISIBLE, CRect(left, top, right, bottom), this, 1))
return false;
m_Prog.SetRange(0, 100);
m_Prog.SetPos(percent);
return true;
}
This works, in the sense it doesn't crash, but it also doesn't do anything.
tia