You were right alexandre, that was the bug...

thanks!

This new patch also includes an intelligent else case for when we don't
have any strings...
--- /devel/corelwineVirgin/corelwine/dlls/comctl32/toolbar.c    Mon May 15 10:47:35 
2000
+++ toolbar.c   Fri Jun  2 17:34:23 2000
@@ -952,9 +952,9 @@
     if (!(infoPtr->himlDef)) {
        /* create new default image list */
        TRACE ("creating default image list!\n");
-       /* It seems that the image list created is 1 pixel taller than the bitmap 
height */
+
        infoPtr->himlDef =
-           ImageList_Create (infoPtr->nBitmapWidth, infoPtr->nBitmapHeight + 1,
+         ImageList_Create (infoPtr->nBitmapWidth, infoPtr->nBitmapHeight,// + 1,
                              ILC_COLOR | ILC_MASK, nButtons, 2);
        infoPtr->himlInt = infoPtr->himlDef;
     }
@@ -1687,13 +1688,21 @@
        lpTbInfo->fsState = btnPtr->fsState;
     if (lpTbInfo->dwMask & TBIF_STYLE)
        lpTbInfo->fsStyle = btnPtr->fsStyle;
-    if (lpTbInfo->dwMask & TBIF_TEXT) {
-       if ((btnPtr->iString >= 0) || (btnPtr->iString < infoPtr->nNumStrings))
-           lstrcpynWtoA (lpTbInfo->pszText,
+     if (lpTbInfo->dwMask & TBIF_TEXT) {
+       
+               /*make sure infoPtr->strings has been allocated before dereferencing 
+it! */
+               if ((btnPtr->iString >= 0) && (btnPtr->iString < infoPtr->nNumStrings))
+               {       
+                       lstrcpynWtoA (lpTbInfo->pszText,
                          (LPWSTR)infoPtr->strings[btnPtr->iString],
                         lpTbInfo->cchText);
-    }
+               }
+               else
+               {
+                       lpTbInfo->pszText[0]=0;
+               }
 
+    }
     return nIndex;
 }

Reply via email to