]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/combobox.cpp
Fixed compilation for !wxUSE_IMAGE as well as !wxUSE_TOOLBAR.
[wxWidgets.git] / src / msw / combobox.cpp
index 4c07746705b74087975651a99d37dc8f31a95f5a..e62a0ed5a71e536413d5869d48c81f8e4bdf1cc5 100644 (file)
@@ -127,7 +127,7 @@ LRESULT APIENTRY _EXPORT wxComboEditWndProc(HWND hWnd,
 // ---------------------------------------------------------------------------
 
 // the pointer to standard radio button wnd proc
-static WXFARPROC gs_wndprocEdit = (WXFARPROC)NULL;
+static WNDPROC gs_wndprocEdit = (WNDPROC)NULL;
 
 // ============================================================================
 // implementation
@@ -399,19 +399,19 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
                         validator, name) )
         return FALSE;
 
-    SetValue(value);
+    // we shouldn't call SetValue() for an empty string because this would
+    // (correctly) result in an assert with a read only combobox and is useless
+    // for the other ones anyhow
+    if ( !value.empty() )
+        SetValue(value);
 
     // a (not read only) combobox is, in fact, 2 controls: the combobox itself
     // and an edit control inside it and if we want to catch events from this
     // edit control, we must subclass it as well
     if ( !(style & wxCB_READONLY) )
     {
-        gs_wndprocEdit = (WXFARPROC)::SetWindowLong
-                                      (
-                                        (HWND)GetEditHWND(),
-                                        GWL_WNDPROC,
-                                        (LPARAM)wxComboEditWndProc
-                                      );
+        gs_wndprocEdit = wxSetWindowProc((HWND)GetEditHWND(),
+                                         wxComboEditWndProc);
     }
 
     // and finally, show the control