VC只支持16色。
可以这么干
m_bmToolbarHi.LoadBitmap( IDB_TOOLBAR_MAINFRAME );
m_wndToolBar.SetBitmap( (HBITMAP)m_bmToolbarHi );

解决方案 »

  1.   

    Using 256 color bitmaps in toolbarIf you create 256 color bitmaps in devstudio, and try to use them with CToolbar it won't work. 
    The problem is in the LoadBitmap() member or CToolbar. Appwizard will create the following line in your CMainFrame class: m_wndToolBar.LoadBitmap(IDR_MAINFRAME) Here is the fix, just replace the load bitmap call with a call to the control itself: m_wndToolBar.GetToolBarCtrl().AddBitmap(iNumButtons,IDR_MAINFRAME);It really is that easy, I found this solution after writing my own toolbar class that used the tool control directly, and 256 color bitmaps worked fine.