555555555555555555555,
竟然告诉我说pWnd是无效的。
我查了,哪个是有效的。
但是tTip没有正确获得,竟然得到的是0。 CToolTipCtrl *tTip = (CToolTipCtrl*)ctrlCBDeskBar.GetToolTips();
tTip->AddTool((CWnd*)&m_wndCBDeskBar, _T("KeyWOrd"), NULL, IDC_CBKEYWORD);
tTip->AddTool((CWnd*)&m_wndCBDeskBar, _T("Exec"), NULL, IDC_CBEXEC);

解决方案 »

  1.   

    AddTool的用法错了,第二个参数我换成了string中的一个资源。
    但是还是出现那个错误。我自己写一个tooltipctrl倒是不出错了,就是现实不出来。 CToolTipCtrl tTipCBDeskBar;
    tTipCBDeskBar.Create((CWnd *)&m_wndCBDeskBar);
    tTipCBDeskBar.AddTool((CWnd*)&m_wndCBDeskBar, ID_CBKEYWORD, CRect(0, 0, 100, 30), IDC_CBKEYWORD);
    CRect rc;
    m_wndCBDeskBar.GetItemRect(8, &rc);
    int nHeight = 30;
    rc.bottom = rc.top + nHeight;
    tTipCBDeskBar.AddTool((CWnd*)&m_wndCBDeskBar, ID_CBEXEC, rc, IDC_CBEXEC);
      

  2.   

    CToolBarCtrl::GetToolTips
    CToolTipCtrl* GetToolTips( ) const;Return ValueA pointer to the CToolTipCtrl object associated with this toolbar or NULL if the toolbar has no associated tool tip control.ResCall this function to retrieve the handle of the tool tip control, if any, associated with the toolbar control. Since the toolbar control normally creates and maintains its own tool tip control, most programs don’t need to call this function.
      

  3.   

    那么我为工具栏创建了一个tooltipctrl呀,为什么还没有显示呢