From e29b83a455bead3dae44300f631d07aa9635d3e9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 12 Jan 1999 23:47:43 +0000 Subject: [PATCH] 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 --- src/msw/imaglist.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/msw/imaglist.cpp b/src/msw/imaglist.cpp index 1ad87888ba..4d969b52ab 100644 --- a/src/msw/imaglist.cpp +++ b/src/msw/imaglist.cpp @@ -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 -- 2.50.0