added an error message if a bitmap can't be addedto the image list

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1386 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 1999-01-12 23:47:43 +00:00
parent f8a3e080aa
commit e29b83a455

View File

@ -86,7 +86,14 @@ int wxImageList::Add(const wxBitmap& bitmap, const wxBitmap& mask)
HBITMAP hBitmap2 = 0;
if ( mask.Ok() )
hBitmap2 = (HBITMAP) mask.GetHBITMAP();
return ImageList_Add((HIMAGELIST) GetHIMAGELIST(), hBitmap1, hBitmap2);
int index = ImageList_Add((HIMAGELIST) GetHIMAGELIST(), hBitmap1, hBitmap2);
if ( index == -1 )
{
wxLogError(_("Couldn't add an image to the image list."));
}
return index;
}
// Adds a bitmap, using the specified colour to create the mask bitmap