解决方案 »

  1.   

    下面的当然也可以,但是你下面的那个imageListTree;是函数内的局部变量,在函数结束的时候就会被自动释放掉,所以你这么写是看不出效果的。
      

  2.   

       CImageList imageListTree;// 局部变量
        imageListTree.Create(32,32,ILC_COLOR32| ILC_MASK ,4,4);
        imageListTree.Add(Icon);
        m_ViewList.SetImageList(&imageListTree,TVSIL_NORMAL);*/
    出 函数  imageListTree 被 析构(删除了!)
      

  3.   

     CImageList imageListTree; 不能使局部变量,你可以使用申明为类的成员变量