我给一个CDialog添加工具提示后显示不了提示,代码如下: CToolTipCtrl * m_tooltip;
m_tooltip = new CToolTipCtrl;
m_tooltip->Create(this);
m_tooltip->AddTool(GetDlgItem(IDC_BUTTON1),"确定");
m_tooltip->Activate(TRUE);请问一下各位,到底是怎么回事?

解决方案 »

  1.   

    pParentWnd
    Specifies the tool tip control’s parent window, usually a CDialog. It must not be NULL.由MSDN的描述可知,你的Create函数,第一个参数应当是NULL。
      

  2.   

    //添加工具提示
    m_tip=new CToolTipCtrl;
    m_tip->Create(this);
    m_tip->AddTool(&m_Restart,_T("计算机"));
    //激活工具提示
    m_tip->Activate(TRUE);
    //重载函数,处理tip
    if (NULL != m_tip)
    {
                m_tip->RelayEvent(pMsg);
    }return CDialog::PreTranslateMessage(pMsg);
      

  3.   

    //重载函数PreTranslateMessage,处理tip
      

  4.   

    //添加工具提示
    m_tip=new CToolTipCtrl;
    m_tip->Create(this);
    m_tip->AddTool(&m_Restart,_T("计算机"));
    //激活工具提示
    m_tip->Activate(TRUE);以上是在初始化中做的
      

  5.   

    搞定,结贴,感谢rshu(破裤男人)