#include "view.h"
 
 #include "wx/cmdline.h"
+#include "wx/config.h"
 
 #ifdef __WXMAC__
     #include "wx/filename.h"
 
     ::wxInitAllImageHandlers();
 
-    SetAppName("DocView Sample");
+    // Fill in the application information fields before creating wxConfig.
+    SetVendorName("wxWidgets");
+    SetAppName("wx_docview_sample");
+    SetAppDisplayName("wxWidgets DocView Sample");
 
     //// Create a document manager
     wxDocManager *docManager = new wxDocManager;
 
     // A nice touch: a history of files visited. Use this menu.
     docManager->FileHistoryUseMenu(menuFile);
+#if wxUSE_CONFIG
+    docManager->FileHistoryLoad(*wxConfig::Get());
+#endif // wxUSE_CONFIG
+
 
     if ( m_mode == Mode_Single )
     {
 
 int MyApp::OnExit()
 {
-    delete wxDocManager::GetDocumentManager();
+    wxDocManager * const manager = wxDocManager::GetDocumentManager();
+#if wxUSE_CONFIG
+    manager->FileHistorySave(*wxConfig::Get());
+#endif // wxUSE_CONFIG
+    delete manager;
 
     return wxApp::OnExit();
 }