我现在想完成ctreectrl 控件用鼠标拖啦的功能,但是发现这个控件很邪门,他必须设置cimagelist,如果设置NULL的话,调用createdragimage他就出错(listctrl就可以不需要)。
我想请问下高人,如何解决这个问题。
void CTPDefine::OnBegindragTree1(NMHDR* pnmhdr, LRESULT* pResult) 
{
// TODO: Add your control notification handler code here
  m_hDragItem = ((NM_TREEVIEW *)pnmhdr)->itemNew.hItem;
  // create a drag image
 
  // Added 7/29/96
  if(m_pDragImage)
delete m_pDragImage;  
    m_pDragImage = m_Tree.CreateDragImage (m_hDragItem);//出错,因为我将m_Tree.SetImageList (NULL, TVSIL_NORMAL);
ASSERT (m_pDragImage);
// changes the cursor to the drag image (DragMove() is still required in 
// OnMouseMove())
VERIFY (m_pDragImage->BeginDrag (0, CPoint (8, 8)));
VERIFY (m_pDragImage->DragEnter (GetDesktopWindow (), ((NM_TREEVIEW *)pnmhdr)->ptDrag));
// set dragging flag
m_bDragging = TRUE;
m_hDropItem = NULL;
m_nDropIndex = -1;
m_pDropWnd = &m_Tree;
// capture all mouse messages
SetCapture ();
*pResult = 0;
}