X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0591bcfdfa1dd68067340bcde7c1b945c3020ccb..160f78e09db9fff2f7c3a1484514835f1d83eb8e:/samples/sound/sound.cpp

diff --git a/samples/sound/sound.cpp b/samples/sound/sound.cpp
index 8273867d7c..4c4c869c83 100644
--- a/samples/sound/sound.cpp
+++ b/samples/sound/sound.cpp
@@ -77,7 +77,7 @@ public:
     void OnAbout(wxCommandEvent& event);
 
     void NotifyUsingFile(const wxString& name);
-    
+
 
 private:
     bool CreateSound(wxSound& snd) const;
@@ -90,7 +90,7 @@ private:
     bool        m_useMemory;
 
     wxTextCtrl* m_tc;
-    
+
     // any class wishing to process wxWidgets events must use this macro
     DECLARE_EVENT_TABLE()
 };
@@ -159,6 +159,9 @@ IMPLEMENT_APP(MyApp)
 // 'Main program' equivalent: the program execution "starts" here
 bool MyApp::OnInit()
 {
+    if ( !wxApp::OnInit() )
+        return false;
+
     // create the main application window
     MyFrame *frame = new MyFrame(_T("wxWidgets Sound Sample"));
 
@@ -981,9 +984,10 @@ void MyFrame::NotifyUsingFile(const wxString& name)
 
 void MyFrame::OnSelectFile(wxCommandEvent& WXUNUSED(event))
 {
+#if wxUSE_FILEDLG
     wxFileDialog dlg(this, _T("Choose a sound file"),
                      wxEmptyString, wxEmptyString,
-                     _T("WAV files (*.wav)|*.wav"), wxOPEN|wxCHANGE_DIR);
+                     _T("WAV files (*.wav)|*.wav"), wxFD_OPEN|wxFD_CHANGE_DIR);
     if ( dlg.ShowModal() == wxID_OK )
     {
         m_soundFile = dlg.GetPath();
@@ -996,6 +1000,7 @@ void MyFrame::OnSelectFile(wxCommandEvent& WXUNUSED(event))
         m_sound = NULL;
         NotifyUsingFile(m_soundFile);
     }
+#endif // wxUSE_FILEDLG
 }
 
 #ifdef __WXMSW__