]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/wince/tbarwce.cpp
Fix memory leak by letting the base class version handle the
[wxWidgets.git] / src / msw / wince / tbarwce.cpp
index 746b2280f94a7ea59c3c5c9a537c8997d526c603..4d8632ca947e30c3b7b9c7ed6d138a0a00982c77 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     2003-07-12
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart
-// Licence:     wxWindows licence
+// Licence:     wxWidgets licence
 /////////////////////////////////////////////////////////////////////////////
 
 // ============================================================================
@@ -41,7 +41,7 @@
 
 // Use the WinCE-specific toolbar only if we're either compiling
 // with a WinCE earlier than 4, or we wish to emulate a PocketPC-style UI
-#if wxUSE_TOOLBAR && wxUSE_TOOLBAR_NATIVE && (_WIN32_WCE < 400 || wxUSE_POCKETPC_UI)
+#if wxUSE_TOOLBAR && wxUSE_TOOLBAR_NATIVE && (_WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP))
 
 #include "wx/toolbar.h"
 
@@ -56,7 +56,7 @@
 #include <ole2.h>
 #include <shellapi.h>
 #include <commctrl.h>
-#if _WIN32_WCE < 400
+#if _WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)
   #include <aygshell.h>
 #endif
 #include "wx/msw/wince/missing.h"
@@ -249,17 +249,14 @@ bool wxToolBar::MSWCreateToolbar(const wxPoint& pos, const wxSize& size, wxMenuB
     if (m_menuBar)
         m_menuBar->SetToolBar(this);
 
-#if _WIN32_WCE >= 400
-    HWND hWnd = CommandBar_Create(wxGetInstance(), (HWND) GetParent()->GetHWND(), GetId());
-    SetHWND((WXHWND) hWnd);
-#else
+#if _WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)
     // Create the menubar.
     SHMENUBARINFO mbi;
     
     memset (&mbi, 0, sizeof (SHMENUBARINFO));
     mbi.cbSize     = sizeof (SHMENUBARINFO);
     mbi.hwndParent = (HWND) GetParent()->GetHWND();
-#if wxUSE_SMARTPHONE
+#ifdef __SMARTPHONE__
     mbi.nToolBarId = 5002;
 #else
     mbi.nToolBarId = 5000;
@@ -276,9 +273,12 @@ bool wxToolBar::MSWCreateToolbar(const wxPoint& pos, const wxSize& size, wxMenuB
     }
     
     SetHWND((WXHWND) mbi.hwndMB);
+#else
+    HWND hWnd = CommandBar_Create(wxGetInstance(), (HWND) GetParent()->GetHWND(), GetId());
+    SetHWND((WXHWND) hWnd);
 #endif
 
-    // install wxWindows window proc for this window
+    // install wxWidgets window proc for this window
     SubclassWin(m_hWnd);
 
     if (menuBar)