The following code was added to int CMFCToolBarImages::AddImage(const CMFCToolBarImages& imageList, int nIndex)in Visual Studio 2010. The problem looks to be with accessing the ds.dsBmih structure since this strcture is all zero causing the biPlanes to be set to 0 causing the CreateDIBSection to fail.I think they may have wanted to use the ds.dsBm which is correctly filled in. if (imageList.m_nBitsPerPixel >= 24 && ::GetObject(m_hbmImageWell, sizeof(DIBSECTION), &ds) != 0) { BITMAPINFO bi = {0}; bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bi.bmiHeader.biWidth = imageList.m_sizeImage.cx; bi.bmiHeader.biHeight = imageList.m_sizeImage.cy; bi.bmiHeader.biPlanes = ds.dsBmih.biPlanes; bi.bmiHeader.biBitCount = ds.dsBmih.biBitCount; bi.bmiHeader.biCompression = BI_RGB; COLORREF* pBits = NULL; HBITMAP hNewBitmap = ::CreateDIBSection(dc, &bi, DIB_RGB_COLORS, (void **)&pBits, NULL, NULL); bitmap.Attach (hNewBitmap); }
Visual Studio/Silverlight/Tooling version
What category (if any) best represents this feedback?
Steps to reproduce
Product Language
Operating System
Operating System Language
Actual results
Expected results
Please wait...