我用ATL写了一个ActiveX控件,然后在属性页里加了一个CTreeCtrl控件,但是我在执行下面的语句时报错:
         icon[1]=AfxGetApp()->LoadIcon (IDI_ICON1);
ctrlTagTree->SetBkColor(RGB(0,250,255));这是什么原因啊,怎么解决呢????????
谢谢大家帮帮忙!!!!!!!!!!!!!!!

解决方案 »

  1.   

    上面没什么错误信息
    标题信息是Microsoft Visual C++ Debug Library
      

  2.   

    工程设为debug模式
    按F5调试 出现断言错误时点击重试
    这个时候在call stack里面就可以看到是调用哪条语句出错了
      

  3.   

    to yecheng_110
    我截个屏发给你吧!
    有没有MSN?
      

  4.   

    _AFXWIN_INLINE HINSTANCE AFXAPI AfxGetResourceHandle()
    { ASSERT(afxCurrentResourceHandle != NULL);
      

  5.   

    _AFXWIN_INLINE HINSTANCE AFXAPI AfxGetResourceHandle()
    { ASSERT(afxCurrentResourceHandle != NULL);在call stack里面的?
      

  6.   

    ctrlTagTree->SetBkColor(RGB(0,250,255));
    是在下面报错_AFXCMN_INLINE COLORREF CTreeCtrl::SetBkColor(COLORREF clr)
    { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, TVM_SETBKCOLOR, 0, (LPARAM)clr); }
      

  7.   

    afxCurrentResourceHandle 不能为 NULL
    你的程序里哪条语句调用的这里
      

  8.   

    If you specify the tree control in a dialog box template, or if you are using CTreeView, your tree control is created automatically when the dialog box or view is created. If you want to create the tree control as a child window of some other window, use the Create member function. If you create the tree control using Create, you must pass it WS_VISIBLE, in addition to other tree view styles.
      

  9.   

    不好意思,我是初学者,还是不太明白!!!!在 dialog box template里应该怎么样使用CTreeCtrl控件了
      

  10.   

    看看msdn
    还有google
    下班了
    还有多调试