m_pWindowDisabler = (wxWindowDisabler *)NULL;
     m_modalData = NULL;
     SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
     m_pWindowDisabler = (wxWindowDisabler *)NULL;
     m_modalData = NULL;
     SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
     Create(parent, wxID_ANY, title, wxPoint(x, y), wxSize(w, h), style, name);
 }
 
     Create(parent, wxID_ANY, title, wxPoint(x, y), wxSize(w, h), style, name);
 }
 
 {
     // nothing to do, obsolete method
 } // end of wxDialog::SetModal
 
 {
     // nothing to do, obsolete method
 } // end of wxDialog::SetModal
 
-    if (GetTitle().c_str())
-        ::WinSetWindowText((HWND)GetHwnd(), (PSZ)GetTitle().c_str());
+    wxString title = GetTitle();
+    if (!title.empty())
+        ::WinSetWindowText((HWND)GetHwnd(), (PSZ)title.c_str());
         // if we didn't call Layout() from here
         //
         // NB: normally we should call it just the first time but doing it
         // if we didn't call Layout() from here
         //
         // NB: normally we should call it just the first time but doing it