D:\inter\debug\msado15.tlh(405) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
D:\Inter\SystemTray.cpp(1082) : error C2065: 'IDANI_CAPTION' : undeclared identifierD:\intra\release\msado15.tlh(405) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
D:\Intra\NTLCtrl.cpp(26) : warning C4305: '=' : truncation from 'const int' to 'char'
D:\Intra\NTLCtrl.cpp(26) : warning C4309: '=' : truncation of constant value
D:\Intra\SystemTray.cpp(1082) : error C2065: 'IDANI_CAPTION' : undeclared identifier
D:\Intra\TRV.cpp(588) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
D:\Intra\TRV.cpp(590) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)

解决方案 »

  1.   

    警告可以不用理会。只有一个错误,IDANI_CAPTION  符号未定义。看看是不是?
      

  2.   

    这个东东看上去象是一个控件号,你如果是在resource edit画控件用到的,那么VS应该会帮你在resource.h中加上:
    #define IDANI_CAPTION XXXX
    这样的语句.如果因为某种原因,VS丢了(多半是你的原因),你可以手工加进去.
    如果不是,你就得慢慢找了.
      

  3.   

    如果是控件ID,你首先应该确定在SystemTray.cpp里加入了#include "resouce.h"。
      

  4.   

    SystemTray.cpp里加入了#include "resouce.h"
    试试看。。
      

  5.   

    1、在resource.h中加入了define IDANI_CAPTION 10076
    2、在systemTray.cpp中加入了#include "resource.h"
    但是还是编译不能成功。
    但我昨天有一次是编译成功了的,而且应用程序运行也是正常的……
    为什么第一次编译正常,第二次就不正常了呢???
    科学应该具备可重复性啊
      

  6.   

    呵呵,科学是具备重复性的,如果你把重新整个编译一下,先清除以前编译的东西,那么你现在估计就会发现错误了,try it -happy coding
      

  7.   

    干脆把这个控件都删掉了,再新加一个。
    搜索整个工程看看哪里用到IDANI_CAPTION的然后把控件资源相关的代码都删除,再重新加一个名称和资源ID都一样的控件
      

  8.   

    你在资源编辑时将控件删除了,但代码之中还有该控件的代码。
    是这种情况的话,请将该控件的代码删除。(这种情况加resouce.h是没有用的,因为resouce.h之中已经没有该控件的id)
    我还有一点想说:警告不要不理。因为有时警告是致命的。(我遇到过多次,多在非mfc的dll与线程中)
    再不行就清除,重建全部。
      

  9.   

    IDANI_CAPTION只有下面两个地方用了,其它地方都没有哦:部分代码段如下:
    void CSystemTray::MinimiseToTray(CWnd* pWnd)
    {
    #ifndef _WIN32_WCE
        if (GetDoWndAnimation())
        {
            CRect rectFrom, rectTo;        pWnd->GetWindowRect(rectFrom);
            GetTrayWndRect(rectTo);     DrawAnimatedRects(pWnd->m_hWnd, IDANI_CAPTION, rectFrom, rectTo);  //此处出错了
        }    RemoveTaskbarIcon(pWnd);
        pWnd->ModifyStyle(WS_VISIBLE, 0);
    #endif
    }void CSystemTray::MaximiseFromTray(CWnd* pWnd)
    {
    #ifndef _WIN32_WCE
        if (GetDoWndAnimation())
        {
            CRect rectTo;
            pWnd->GetWindowRect(rectTo);        CRect rectFrom;
            GetTrayWndRect(rectFrom);        pWnd->SetParent(NULL);
        DrawAnimatedRects(pWnd->m_hWnd, IDANI_CAPTION, rectFrom, rectTo);  //此处未出错
        }
        else
            pWnd->SetParent(NULL);    pWnd->ModifyStyle(0, WS_VISIBLE);
        pWnd->RedrawWindow(NULL, NULL, RDW_UPDATENOW | RDW_ALLCHILDREN | RDW_FRAME |
                                       RDW_INVALIDATE | RDW_ERASE);    // Move focus away and back again to ensure taskbar icon is recreated
        if (::IsWindow(m_wndInvisible.m_hWnd))
            m_wndInvisible.SetActiveWindow();
        pWnd->SetActiveWindow();
        pWnd->SetForegroundWindow();
    #endif
    }
    出错信息:
    d:\intra\release\msado15.tlh(405) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
    D:\Intra\NewTreeListCtrl.cpp(26) : warning C4305: '=' : truncation from 'const int' to 'char'
    D:\Intra\NewTreeListCtrl.cpp(26) : warning C4309: '=' : truncation of constant value
    D:\Intra\SystemTray.cpp(1082) : error C2065: 'IDANI_CAPTION' : undeclared identifier
    D:\Intra\TRView.cpp(588) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
    D:\Intra\TRView.cpp(590) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
      

  10.   

    摆明了是资源编号,在resource.h中定义就可以了.
      

  11.   

    把某个资源的ID号改成IDANI_CAPTION就可以了。