PATCH: Creating a property sheet dialog causes assertion in debug MFC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi. PROPSHEET_CreateDialog wasn't returning the right (documented) values.
This caused the debug MFC library to assert.

Cyberscience disclaims all copyright and responsibility... ;-)

Changelog:

        * dlls/comctl32/propsheet.c: Adam Gundy <arg@cyberscience.com>
        PROPSHEET_CreateDialog() is documented to return -1 on failure,
        and the dialog handle on success. Prevents assertion in debug
        MFC library.

diff -u -r wine-20030219/dlls/comctl32/propsheet.c wine-20030219-new/dlls/comctl32/propsheet.c
--- wine-20030219/dlls/comctl32/propsheet.c     Fri Jan 24 00:54:59 2003
+++ wine-20030219-new/dlls/comctl32/propsheet.c Mon Feb 24 17:23:13 2003
@@ -118,7 +118,7 @@
 /******************************************************************************
  * Prototypes
  */
-static BOOL PROPSHEET_CreateDialog(PropSheetInfo* psInfo);
+static int PROPSHEET_CreateDialog(PropSheetInfo* psInfo);
 static BOOL PROPSHEET_SizeMismatch(HWND hwndDlg, PropSheetInfo* psInfo);
 static BOOL PROPSHEET_AdjustSize(HWND hwndDlg, PropSheetInfo* psInfo);
 static BOOL PROPSHEET_AdjustButtons(HWND hwndParent, PropSheetInfo* psInfo);
@@ -552,7 +552,7 @@
  *
  * Creates the actual property sheet.
  */
-BOOL PROPSHEET_CreateDialog(PropSheetInfo* psInfo)
+int PROPSHEET_CreateDialog(PropSheetInfo* psInfo)
 {
   LRESULT ret;
   LPCVOID template;
@@ -568,10 +568,10 @@
   if(!(hRes = FindResourceW(COMCTL32_hModule,
                             MAKEINTRESOURCEW(resID),
                             RT_DIALOGW)))
-    return FALSE;
+    return -1;
 
   if(!(template = (LPVOID)LoadResource(COMCTL32_hModule, hRes)))
-    return FALSE;
+    return -1;
 
   /*
    * Make a copy of the dialog template.
@@ -581,7 +581,7 @@
   temp = COMCTL32_Alloc(resSize);
 
   if (!temp)
-    return FALSE;
+    return -1;
 
   memcpy(temp, template, resSize);
 
@@ -595,11 +595,14 @@
                                     PROPSHEET_DialogProc,
                                     (LPARAM)psInfo);
   else
+  {
       ret = CreateDialogIndirectParamW(psInfo->ppshheader.hInstance,
                                        (LPDLGTEMPLATEW) temp,
                                        psInfo->ppshheader.hwndParent,
                                        PROPSHEET_DialogProc,
-                                       (LPARAM)psInfo) ? TRUE : FALSE;
+                                       (LPARAM)psInfo);
+      if ( !ret ) ret = -1;
+  }
 
   COMCTL32_Free(temp);
 


Seeya,
 Adam
--
Real Programmers don't comment their code. If it was hard to write,
it should be hard to read, and even harder to modify.
These are all my own opinions.



[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux