制作一个工具栏
m_toolbar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);

HBITMAP hbm = (HBITMAP)::LoadImage(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDB_BITMAP1),
IMAGE_BITMAP, //按位图格式
0,0, // cx,cy
LR_CREATEDIBSECTION | LR_LOADMAP3DCOLORS );
CBitmap bm;
bm.Attach(hbm);
m_list.Create(32,32,ILC_COLOR8, 1, 1);
m_list.Add(&bm,(CBitmap*)NULL);
m_toolbar.GetToolBarCtrl()->SetImageList(&m_list);
其中m_list 为CImageList 对象
错误提示:
ompiling...
MainFrm.cpp
E:\vc++程序\fortext\MainFrm.cpp(80) : error C2819: type 'CToolBarCtrl' does not have an overloaded member 'operator ->'
        g:\vc98\mfc\include\afxcmn.h(856) : see declaration of 'CToolBarCtrl'
E:\vc++程序\fortext\MainFrm.cpp(80) : error C2227: left of '->SetImageList' must point to class/struct/union
Error executing cl.exe.MainFrm.obj - 2 error(s), 0 warning(s)
谢谢大家