+#if defined(__WXWINCE__)
+ if (!m_hMenu)
+ this->Create();
+#if _WIN32_WCE < 400 || defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)
+
+ // No idea why this was here, but it seems to be obsolete.
+ // Remove after testing with other WinCE combinations - April 2004
+#if 0
+ if (GetToolBar())
+ {
+ HWND hCommandBar = (HWND) GetToolBar()->GetHWND();
+ if (!CommandBar_InsertMenubarEx(hCommandBar, NULL, (LPTSTR) m_hMenu, 0))
+ {
+ wxLogLastError(wxT("CommandBar_InsertMenubarEx"));
+ }
+ }
+#endif
+#else
+ if (!m_commandBar)
+ m_commandBar = (WXHWND) CommandBar_Create(wxGetInstance(), (HWND) frame->GetHWND(), NewControlId());
+ if (m_commandBar)
+ {
+ if (m_hMenu)
+ {
+ if (!CommandBar_InsertMenubarEx((HWND) m_commandBar, NULL, (LPTSTR) m_hMenu, 0))
+ {
+ wxLogLastError(wxT("CommandBar_InsertMenubarEx"));
+ }
+ }
+ }
+#endif
+ // PSPC/WFSP
+#endif
+ // __WXWINCE__ && _WIN32_WCE >= 400
+