]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/db/dbtest.cpp
AssociateHandle and DissociateHandle
[wxWidgets.git] / samples / db / dbtest.cpp
index 016c7248860a3b33de12e95693c57c7c01d4631d..dbae3482f06c74bb6662038631297543a2d529d5 100644 (file)
@@ -839,13 +839,17 @@ DatabaseDemoFrame::DatabaseDemoFrame(wxFrame *frame, const wxString& title,
     pEditorDlg = NULL;
     pParamDlg  = NULL;
 
+#if wxUSE_LOG
     delete wxLog::SetActiveTarget(new wxLogStderr);
+#endif // wxUSE_LOG
 
 }  // DatabaseDemoFrame constructor
 
 DatabaseDemoFrame::~DatabaseDemoFrame()
 {
+#if wxUSE_LOG
     delete wxLog::SetActiveTarget(NULL);
+#endif // wxUSE_LOG
 }  // DatabaseDemoFrame destructor
 
 
@@ -2223,21 +2227,17 @@ void CparameterDlg::FillDataSourceList()
 {
     wxChar Dsn[SQL_MAX_DSN_LENGTH + 1];
     wxChar DsDesc[255];
-    wxStringList strList;
+    wxSortedArrayString strArr;
 
     while (wxDbGetDataSource(wxGetApp().DbConnectInf->GetHenv(), Dsn,
                              SQL_MAX_DSN_LENGTH+1, DsDesc, 255))
-        strList.Add(Dsn);
-
-    strList.Sort();
-    strList.Add(wxT(""));
+    {
+        strArr.Add(Dsn);
+    }
 
-    wxString current;
-    for (wxStringList::Node *node = strList.GetFirst(); node; node = node->GetNext() )
+    for (size_t i=0; i < strArr.GetCount(); i++ )
     {
-        current = node->GetData();
-        if(!current.IsEmpty())
-            pParamODBCSourceList->Append(current.c_str());
+        pParamODBCSourceList->Append(strArr[i].c_str());
     }
 
 }  // CparameterDlg::FillDataSourceList()