解决方案 »

  1.   

    http://blog.sina.com.cn/s/blog_5e8782250100c9t6.html
    这里不是有完整的实例吗?
      

  2.   


    楼上给的链接我看了,非常好,而且东西也做出来,就是有一个地方,有个疑问:
    /*
       // load our button's icon and create the image list to house it.
       HICON hMotley = LoadIcon(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_MOTLEY));
       m_hImageList = ImageList_Create(16,16, ILC_COLOR16, 1, 0);
       int iImageIndex = ImageList_AddIcon(m_hImageList, hMotley);
       DestroyIcon(hMotley);
       // Set the toolbar's image
       ::SendMessage(m_hWnd, TB_SETIMAGELIST, 0, (LPARAM)m_hImageList);
    */这个我一放开的话,就会报一个错误: IDI_MOTLEY 报这个没有定义,我定义的类名等都和文章里面的一致,就楼上指教一下。多谢。因为没接触过ATL,现在只是为了实现功能而实现,其他的没研究,遇到问题,只好发帖求教,多谢。
      

  3.   


    楼上给的链接我看了,非常好,而且东西也做出来,就是有一个地方,有个疑问:
    /*
       // load our button's icon and create the image list to house it.
       HICON hMotley = LoadIcon(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_MOTLEY));
       m_hImageList = ImageList_Create(16,16, ILC_COLOR16, 1, 0);
       int iImageIndex = ImageList_AddIcon(m_hImageList, hMotley);
       DestroyIcon(hMotley);
       // Set the toolbar's image
       ::SendMessage(m_hWnd, TB_SETIMAGELIST, 0, (LPARAM)m_hImageList);
    */这个我一放开的话,就会报一个错误: IDI_MOTLEY 报这个没有定义,我定义的类名等都和文章里面的一致,就楼上指教一下。多谢。因为没接触过ATL,现在只是为了实现功能而实现,其他的没研究,遇到问题,只好发帖求教,多谢。
      

  4.   


    楼上给的链接我看了,非常好,而且东西也做出来,就是有一个地方,有个疑问:
    /*
       // load our button's icon and create the image list to house it.
       HICON hMotley = LoadIcon(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_MOTLEY));
       m_hImageList = ImageList_Create(16,16, ILC_COLOR16, 1, 0);
       int iImageIndex = ImageList_AddIcon(m_hImageList, hMotley);
       DestroyIcon(hMotley);
       // Set the toolbar's image
       ::SendMessage(m_hWnd, TB_SETIMAGELIST, 0, (LPARAM)m_hImageList);
    */这个我一放开的话,就会报一个错误: IDI_MOTLEY 报这个没有定义,我定义的类名等都和文章里面的一致,就楼上指教一下。多谢。因为没接触过ATL,现在只是为了实现功能而实现,其他的没研究,遇到问题,只好发帖求教,多谢。
    IDI_MOTLEY  这应该是一个图标资源
      

  5.   

     IDI_MOTLEY 报这个没有定义
    同上,看看这个图标资源在resource.h中是否有定义,资源是否引入了