我在一个TreeView的OnUpdate中加入了下面的程序,
想在TreeView中插入一个树状的节点,但是只显示
节点的文本,它的图标显示不出来,高手帮我看看
为什么?void CLeftView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint) 
{
HICON hIcon[2];
CImageList m_ImageList;
m_ImageList.Create(16,16,0,8,8);
hIcon[0] = AfxGetApp()->LoadIcon(IDI_ICON_A);
hIcon[1] = AfxGetApp()->LoadIcon(IDI_ICON_B);
m_ImageList.Add(hIcon[0]);
m_ImageList.Add(hIcon[1]);

GetTreeCtrl().SetImageList(&m_ImageList, TVSIL_NORMAL);
TV_INSERTSTRUCT tvstruct;
tvstruct.hParent = NULL;
tvstruct.hInsertAfter = TVI_LAST;
tvstruct.item.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE |
TVIF_TEXT;
tvstruct.item.hItem = NULL;
tvstruct.item.state = 0;
tvstruct.item.stateMask = 0;
tvstruct.item.iSelectedImage = 1;
tvstruct.item.iImage = 0;
tvstruct.item.pszText = "Homer";
GetTreeCtrl().InsertItem(&tvstruct);}