楼上给的链接我看了,非常好,而且东西也做出来,就是有一个地方,有个疑问: /* // 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,现在只是为了实现功能而实现,其他的没研究,遇到问题,只好发帖求教,多谢。
楼上给的链接我看了,非常好,而且东西也做出来,就是有一个地方,有个疑问: /* // 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,现在只是为了实现功能而实现,其他的没研究,遇到问题,只好发帖求教,多谢。
楼上给的链接我看了,非常好,而且东西也做出来,就是有一个地方,有个疑问: /* // 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 这应该是一个图标资源
这里不是有完整的实例吗?
楼上给的链接我看了,非常好,而且东西也做出来,就是有一个地方,有个疑问:
/*
// 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,现在只是为了实现功能而实现,其他的没研究,遇到问题,只好发帖求教,多谢。
楼上给的链接我看了,非常好,而且东西也做出来,就是有一个地方,有个疑问:
/*
// 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,现在只是为了实现功能而实现,其他的没研究,遇到问题,只好发帖求教,多谢。
楼上给的链接我看了,非常好,而且东西也做出来,就是有一个地方,有个疑问:
/*
// 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 这应该是一个图标资源
同上,看看这个图标资源在resource.h中是否有定义,资源是否引入了