]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/db/dbtest.cpp
AssociateHandle and DissociateHandle
[wxWidgets.git] / samples / db / dbtest.cpp
index 95d9b392ea39d6cdd88586c5ec8227d03fa6a144..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
 
 
@@ -1571,7 +1575,7 @@ bool CeditorDlg::Initialize()
     choice_strings[3] = wxT("Spanish");
     choice_strings[4] = wxT("Other");
 
-    pNativeLangChoice = new wxChoice(this, EDITOR_DIALOG_LANG_CHOICE,                             wxPoint( 17, 346), wxSize(277,  wxDefaultSize.y), 5, choice_strings);
+    pNativeLangChoice = new wxChoice(this, EDITOR_DIALOG_LANG_CHOICE,                             wxPoint( 17, 346), wxSize(277,  wxDefaultCoord), 5, choice_strings);
     pNativeLangMsg    = new wxStaticText(this, EDITOR_DIALOG_LANG_MSG,   wxT("Native language:"), wxPoint( 17, 330), wxDefaultSize, 0, wxT("NativeLangMsg"));
 
     wxString radio_strings[2];
@@ -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()