From: Julian Smart Date: Sun, 8 Feb 2004 11:53:48 +0000 (+0000) Subject: Applied [ 880011 ] Several fixes to DbBrowse demo X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/74de91cc974062b9eaddc7c0ccbfb07013bd0611 Applied [ 880011 ] Several fixes to DbBrowse demo ABX git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25611 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/demos/dbbrowse/browsedb.cpp b/demos/dbbrowse/browsedb.cpp index c228de80ac..9583c776b1 100644 --- a/demos/dbbrowse/browsedb.cpp +++ b/demos/dbbrowse/browsedb.cpp @@ -201,7 +201,7 @@ bool BrowserDB::OnCloseDB(int Quiet) } //---------------------------------------------------------------------------------------- -bool BrowserDB::OnGetNext(int Cols,int Quiet) +bool BrowserDB::OnGetNext(int Cols,int WXUNUSED(Quiet)) { SDWORD cb; int i_dbDataType; @@ -215,11 +215,13 @@ bool BrowserDB::OnGetNext(int Cols,int Quiet) //----------------------------- if (!db_BrowserDB->GetNext()) { - return FALSE; +#ifdef __WXDEBUG__ Temp0.Printf(_("\n-E-> BrowserDB::OnGetNext - ODBC-Error with GetNext \n-E-> ")); Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__); wxLogMessage(Temp0); wxMessageBox(Temp0); +#endif + return FALSE; } else { @@ -344,7 +346,8 @@ bool BrowserDB::OnSelect(wxString tb_Name, int Quiet) wxString SQLStmt; i_Records = 0; //--------------------------------------------------------------------------------------- - SQLStmt.sprintf(_T("SELECT * FROM %s"),db_BrowserDB->SQLTableName(tb_Name.c_str())); + wxString tablename = db_BrowserDB->SQLTableName(tb_Name.c_str()); + SQLStmt.sprintf(_T("SELECT * FROM %s"),tablename.c_str()); if (!db_BrowserDB->ExecSql((wxChar *)(SQLStmt.GetData()))) { Temp0.Printf(_("\n-E-> BrowserDB::OnSelect - ODBC-Error with ExecSql of >%s<.\n-E-> "),tb_Name.c_str()); @@ -398,7 +401,7 @@ bool BrowserDB::OnExecSql(wxString SQLStmt, int Quiet) } //---------------------------------------------------------------------------------------- -wxDbInf* BrowserDB::OnGetCatalog(int Quiet) +wxDbInf* BrowserDB::OnGetCatalog(int WXUNUSED(Quiet)) { wxChar UName[255]; wxStrcpy(UName,UserName); @@ -407,7 +410,7 @@ wxDbInf* BrowserDB::OnGetCatalog(int Quiet) } //---------------------------------------------------------------------------------------- -wxDbColInf* BrowserDB::OnGetColumns(wxChar *tableName, UWORD numCols, int Quiet) +wxDbColInf* BrowserDB::OnGetColumns(wxChar *tableName, UWORD numCols, int WXUNUSED(Quiet)) { wxChar UName[255]; int i; diff --git a/demos/dbbrowse/dbgrid.cpp b/demos/dbbrowse/dbgrid.cpp index 8887a4f087..638c82c8bb 100644 --- a/demos/dbbrowse/dbgrid.cpp +++ b/demos/dbbrowse/dbgrid.cpp @@ -85,7 +85,7 @@ int DBGrid::OnTableView(wxString Table) { wxStopWatch sw; //--------------------------------------------------------------------------------------- - int i=0,x,y,z, ValidTable=0; + int x,y,z; wxString Temp0; wxBeginBusyCursor(); SetDefaultCellFont(* pDoc->ft_Doc); @@ -98,13 +98,13 @@ int DBGrid::OnTableView(wxString Table) { if (!wxStrcmp((ct_BrowserDB->pTableInf+x)->tableName,Table)) // is this our Table ? { // Yes, the Data of this Table shall be put into the Grid - ValidTable = x; // Save the Tablenumber + int ValidTable = x; // Save the Tablenumber (db_Br+i_Which)->OnSelect(Table,FALSE); // Select * from "table" // Set the local Pointer to the Column Information we are going to use (db_Br+i_Which)->cl_BrowserDB = (ct_BrowserDB->pTableInf+x)->pColInf; if ((ct_BrowserDB->pTableInf+x)->pColInf) // Valid pointer (!= NULL) ? { // Pointer is Valid, Column Informationen sind Vorhanden - i = (db_Br+i_Which)->i_Records; // How many Records are there + int i = (db_Br+i_Which)->i_Records; // How many Records are there (db_Br+i_Which)->i_Which = ValidTable; // Still used ???? mj10777 if (i == 0) // If the Table is empty, then show one empty row i++; @@ -154,7 +154,7 @@ Weiter: } //---------------------------------------------------------------------------------------- -void DBGrid::OnModusEdit(wxCommandEvent& event) +void DBGrid::OnModusEdit(wxCommandEvent& WXUNUSED(event)) { b_EditModus = TRUE; // Needed by PopupMenu EnableEditing(b_EditModus); // Activate in-place Editing @@ -163,7 +163,7 @@ void DBGrid::OnModusEdit(wxCommandEvent& event) } //---------------------------------------------------------------------------------------- -void DBGrid::OnModusBrowse(wxCommandEvent& event) +void DBGrid::OnModusBrowse(wxCommandEvent& WXUNUSED(event)) { b_EditModus = FALSE; // Needed by PopupMenu EnableEditing(b_EditModus); // Deactivate in-place Editing diff --git a/demos/dbbrowse/dbtree.cpp b/demos/dbbrowse/dbtree.cpp index 557b3c9adc..e2ee978102 100644 --- a/demos/dbbrowse/dbtree.cpp +++ b/demos/dbbrowse/dbtree.cpp @@ -355,7 +355,7 @@ void DBTree::OnRightSelect(wxTreeEvent& WXUNUSED(event)) } //---------------------------------------------------------------------------------------- -void DBTree::OnDBGrid(wxCommandEvent& event) +void DBTree::OnDBGrid(wxCommandEvent& WXUNUSED(event)) { int i; // Get the Information that we need @@ -378,7 +378,7 @@ void DBTree::OnDBGrid(wxCommandEvent& event) } //---------------------------------------------------------------------------------------- -void DBTree::OnDBClass(wxCommandEvent& event) +void DBTree::OnDBClass(wxCommandEvent& WXUNUSED(event)) { // int i; // Get the Information that we need @@ -392,7 +392,7 @@ void DBTree::OnDBClass(wxCommandEvent& event) } //---------------------------------------------------------------------------------------- -void DBTree::OnTableClass(wxCommandEvent& event) +void DBTree::OnTableClass(wxCommandEvent& WXUNUSED(event)) { int i; // Get the Information that we need @@ -414,7 +414,7 @@ void DBTree::OnTableClass(wxCommandEvent& event) } //---------------------------------------------------------------------------------------- -void DBTree::OnTableClassAll(wxCommandEvent& event) +void DBTree::OnTableClassAll(wxCommandEvent& WXUNUSED(event)) { // int i; // Get the Information that we need diff --git a/demos/dbbrowse/doc.cpp b/demos/dbbrowse/doc.cpp index ab3b9a73a5..a9ccf11ac8 100644 --- a/demos/dbbrowse/doc.cpp +++ b/demos/dbbrowse/doc.cpp @@ -114,6 +114,7 @@ bool MainDoc::OnInitView() p_TabArea->AddTab(p_PgmCtrl,_T("PgmCtrl"),p_FolderClose); delete p_FolderClose; // Memory leak p_FolderClose = NULL; + wxUnusedVar(p_FolderClose); //--------------------------------------------------------------------------------------- // now create "output" window //--------------------------------------------------------------------------------------- @@ -156,7 +157,7 @@ bool MainDoc::OnInitODBC() wxChar DsDesc[255]; // BJO20002501 instead of 512 Temp0 = _T(""); i_DSN = 0; // Counter - int i = 0; + int i; //--------------------------------------------------------------------------------------- // Initialize the ODBC Environment for Database Operations @@ -200,7 +201,6 @@ bool MainDoc::OnInitODBC() Temp0.Printf(_T("%02d) Dsn(%s) DsDesc(%s)"),i,(p_DSN+i)->Dsn.c_str(),(p_DSN+i)->Drv.c_str()); wxLogMessage(Temp0); } - i = 0; //--------------------------------------------------------------------------------------- // Allocate n wxDatabase objects to hold the column information db_Br = new BrowserDB[i_DSN]; diff --git a/demos/dbbrowse/tabpgwin.cpp b/demos/dbbrowse/tabpgwin.cpp index d11286c20c..6de25f0824 100644 --- a/demos/dbbrowse/tabpgwin.cpp +++ b/demos/dbbrowse/tabpgwin.cpp @@ -157,24 +157,24 @@ wxTabbedWindow::wxTabbedWindow() //--------------------------------------------------------------------------- wxTabbedWindow::~wxTabbedWindow() { - wxNode* pTab = mTabs.First(); + wxNode* pTab = mTabs.GetFirst(); while( pTab ) { - delete ((twTabInfo*)pTab->Data()); - pTab = pTab->Next(); + delete ((twTabInfo*)pTab->GetData()); + pTab = pTab->GetNext(); } } //--------------------------------------------------------------------------- -void wxTabbedWindow::SizeTabs(int x,int y, int width, int height, bool repant) +void wxTabbedWindow::SizeTabs(int x,int y, int width, int height, bool WXUNUSED(repant)) { - wxNode* pTabNode = mTabs.First(); - int n = 0; + wxNode* pTabNode = mTabs.GetFirst(); + size_t n = 0; while( pTabNode ) { - twTabInfo& info = *((twTabInfo*)pTabNode->Data()); + twTabInfo& info = *((twTabInfo*)pTabNode->GetData()); if ( n == mActiveTab ) { @@ -191,7 +191,7 @@ void wxTabbedWindow::SizeTabs(int x,int y, int width, int height, bool repant) info.mpContent->Show(FALSE); } - pTabNode = pTabNode->Next(); + pTabNode = pTabNode->GetNext(); ++n; } } @@ -249,26 +249,26 @@ void wxTabbedWindow::AddTab( wxWindow* pContent, //--------------------------------------------------------------------------- void wxTabbedWindow::RemoveTab( int tabNo ) { - twTabInfo* pTab = ((twTabInfo*)(mTabs.Nth( tabNo )->Data())); + twTabInfo* pTab = ((twTabInfo*)(mTabs.Item( tabNo )->GetData())); pTab->mpContent->Destroy(); delete pTab; - mTabs.DeleteNode( mTabs.Nth( tabNo ) ); - // if ( mActiveTab >= mTabs.Number() ); - if ( mActiveTab >= mTabs.Number() ) - mActiveTab = mTabs.Number() - 1; + mTabs.DeleteNode( mTabs.Item( tabNo ) ); + // if ( mActiveTab >= mTabs.GetCount() ); + if ( mActiveTab >= mTabs.GetCount() ) + mActiveTab = mTabs.GetCount() - 1; SetActiveTab( mActiveTab ); } //--------------------------------------------------------------------------- int wxTabbedWindow::GetTabCount() { - return mTabs.Number(); + return mTabs.GetCount(); } //--------------------------------------------------------------------------- wxWindow* wxTabbedWindow::GetTab( int tabNo ) { - return ((twTabInfo*)(mTabs.Nth( tabNo )->Data()))->mpContent; + return ((twTabInfo*)(mTabs.Item( tabNo )->GetData()))->mpContent; } //--------------------------------------------------------------------------- @@ -363,14 +363,14 @@ void wxTabbedWindow::DrawDecorations( wxDC& dc ) curX = mFirstTitleGap; curY = height - mVertGap - mTitleHeight; - int tabNo = 0; - wxNode* pNode = mTabs.First(); + size_t tabNo = 0; + wxNode* pNode = mTabs.GetFirst(); while( pNode ) { // "hard-coded metafile" for decorations - twTabInfo& tab = *((twTabInfo*)(pNode->Data())); + twTabInfo& tab = *((twTabInfo*)(pNode->GetData())); xSize = tab.mDims.x; ySize = mTitleHeight; @@ -403,7 +403,7 @@ void wxTabbedWindow::DrawDecorations( wxDC& dc ) dc.DrawLine( curX+xSize-2, curY+ySize-2, curX+xSize-3, curY+ySize-2 ); dc.DrawLine( curX+xSize-3, curY+ySize-1, curX+1, curY+ySize-1 ); - pNode = pNode->Next(); + pNode = pNode->GetNext(); ++tabNo; // darw image and (or without) text centered within the @@ -453,15 +453,12 @@ int wxTabbedWindow::HitTest( const wxPoint& pos ) int curY = height - mVertGap - mTitleHeight; int tabNo = 0; - wxNode* pNode = mTabs.First(); + wxNode* pNode = mTabs.GetFirst(); while( pNode ) { - twTabInfo& tab = *((twTabInfo*)(pNode->Data())); + twTabInfo& tab = *((twTabInfo*)(pNode->GetData())); - int w,h; - w = tab.mDims.x; - h = tab.mDims.y; // hit test rectangle of the currnet tab title bar if ( pos.x >= curX && pos.x < curX + tab.mDims.x && pos.y >= curY && pos.y < curY + tab.mDims.y @@ -472,7 +469,7 @@ int wxTabbedWindow::HitTest( const wxPoint& pos ) curX += tab.mDims.x; - pNode = pNode->Next(); + pNode = pNode->GetNext(); ++tabNo; } @@ -485,18 +482,18 @@ void wxTabbedWindow::HideInactiveTabs( bool andRepaint ) if ( !andRepaint ) return; - wxNode* pNode = mTabs.First(); - int tabNo = 0; + wxNode* pNode = mTabs.GetFirst(); + size_t tabNo = 0; while( pNode ) { if ( tabNo != mActiveTab ) { - twTabInfo& tab = *((twTabInfo*)(pNode->Data())); + twTabInfo& tab = *((twTabInfo*)(pNode->GetData())); tab.mpContent->Show(FALSE); } - pNode = pNode->Next(); + pNode = pNode->GetNext(); ++tabNo; } } // wxTabbedWindow::HideInactiveTabs() @@ -544,14 +541,14 @@ void wxTabbedWindow::RecalcLayout(bool andRepaint) mLayoutType = wxTITLE_IMG_AND_TEXT; - wxNode* pNode = mTabs.First(); + wxNode* pNode = mTabs.GetFirst(); curX = mFirstTitleGap; // the left-side gap mTitleHeight = 0; while( pNode ) { - twTabInfo& tab = *((twTabInfo*)(pNode->Data())); + twTabInfo& tab = *((twTabInfo*)(pNode->GetData())); wxWindowDC dc(this); @@ -570,19 +567,19 @@ void wxTabbedWindow::RecalcLayout(bool andRepaint) curX += tab.mDims.x; - pNode = pNode->Next(); + pNode = pNode->GetNext(); } curX += mHorizGap; // the right-side gap // make all title bars of equel height - pNode = mTabs.First(); + pNode = mTabs.GetFirst(); while( pNode ) { - ((twTabInfo*)(pNode->Data()))->mDims.y = mTitleHeight;; - pNode = pNode->Next(); + ((twTabInfo*)(pNode->GetData()))->mDims.y = mTitleHeight;; + pNode = pNode->GetNext(); } // if curX has'nt ran out of bounds, leave TITLE_IMG layout and return @@ -593,11 +590,11 @@ void wxTabbedWindow::RecalcLayout(bool andRepaint) mLayoutType = wxTITLE_IMG_ONLY; - pNode = mTabs.First(); + pNode = mTabs.GetFirst(); curX = mFirstTitleGap; // the left-side gap - int denomiator = mTabs.Number(); + int denomiator = mTabs.GetCount(); if ( denomiator == 0 ) ++denomiator; @@ -605,7 +602,7 @@ void wxTabbedWindow::RecalcLayout(bool andRepaint) while( pNode ) { - twTabInfo& tab = *((twTabInfo*)(pNode->Data())); + twTabInfo& tab = *((twTabInfo*)(pNode->GetData())); if ( tab.HasImg() ) { @@ -620,7 +617,7 @@ void wxTabbedWindow::RecalcLayout(bool andRepaint) curX += tab.mDims.x; - pNode = pNode->Next(); + pNode = pNode->GetNext(); } curX += mHorizGap; // the right-side gap @@ -633,37 +630,37 @@ void wxTabbedWindow::RecalcLayout(bool andRepaint) mLayoutType = wxTITLE_BORDER_ONLY; - pNode = mTabs.First(); + pNode = mTabs.GetFirst(); while( pNode ) { - twTabInfo& tab = *((twTabInfo*)(pNode->Data())); + twTabInfo& tab = *((twTabInfo*)(pNode->GetData())); tab.mDims.x = mBorderOnlyWidth; tab.mDims.y = mTitleHeight; - pNode = pNode->Next(); + pNode = pNode->GetNext(); } } // wxTabbedWindow::RecalcLayout() //--------------------------------------------------------------------------- // wx event handlers //--------------------------------------------------------------------------- -void wxTabbedWindow::OnPaint( wxPaintEvent& event ) +void wxTabbedWindow::OnPaint( wxPaintEvent& WXUNUSED(event) ) { wxPaintDC dc(this); DrawDecorations( dc ); } //--------------------------------------------------------------------------- -void wxTabbedWindow::OnSize ( wxSizeEvent& event ) +void wxTabbedWindow::OnSize ( wxSizeEvent& WXUNUSED(event) ) { SetBackgroundColour( wxColour( 192,192,192 ) ); RecalcLayout(TRUE); } //--------------------------------------------------------------------------- -void wxTabbedWindow::OnBkErase( wxEraseEvent& event ) +void wxTabbedWindow::OnBkErase( wxEraseEvent& WXUNUSED(event) ) { // do nothing } @@ -749,7 +746,7 @@ wxFont wxPagedWindow::GetLabelingFont() } //--------------------------------------------------------------------------- -void wxPagedWindow::OnTabAdded( twTabInfo* pInfo ) +void wxPagedWindow::OnTabAdded( twTabInfo* WXUNUSED(pInfo) ) { int units = GetWholeTabRowLen() / 20; @@ -771,16 +768,16 @@ wxScrollBar& wxPagedWindow::GetHorizontalScrollBar() //--------------------------------------------------------------------------- int wxPagedWindow::GetWholeTabRowLen() { - wxNode* pNode = mTabs.First(); + wxNode* pNode = mTabs.GetFirst(); int len = 0; while( pNode ) { - twTabInfo& tab = *((twTabInfo*)(pNode->Data())); + twTabInfo& tab = *((twTabInfo*)(pNode->GetData())); len += tab.mDims.x; - pNode = pNode->Next(); + pNode = pNode->GetNext(); } return len; @@ -864,8 +861,8 @@ void wxPagedWindow::DrawDecorations( wxDC& dc ) // draw inactive tab title bars frist (left-to-right) - wxNode* pNode = mTabs.First(); - int tabNo = 0; + wxNode* pNode = mTabs.GetFirst(); + size_t tabNo = 0; /* OLD STUFF:: curX = mTitleRowStart; @@ -892,27 +889,27 @@ void wxPagedWindow::DrawDecorations( wxDC& dc ) while( pNode ) { - twTabInfo& tab = *((twTabInfo*)(pNode->Data())); + twTabInfo& tab = *((twTabInfo*)(pNode->GetData())); if ( tabNo != mActiveTab ) DrawPaperBar( tab, curX, curY, mGrayBrush, mBlackPen, tmpDc ); curX += tab.mDims.x; - pNode = pNode->Next(); + pNode = pNode->GetNext(); ++tabNo; } // finally, draw the active tab (white-filled) - pNode = mTabs.First(); + pNode = mTabs.GetFirst(); tabNo = 0; curX = mTabTrianGap; while( pNode ) { - twTabInfo& tab = *((twTabInfo*)(pNode->Data())); + twTabInfo& tab = *((twTabInfo*)(pNode->GetData())); if ( tabNo == mActiveTab ) { @@ -926,7 +923,7 @@ void wxPagedWindow::DrawDecorations( wxDC& dc ) } curX += tab.mDims.x; - pNode = pNode->Next(); + pNode = pNode->GetNext(); ++tabNo; } @@ -1036,11 +1033,11 @@ void wxPagedWindow::RecalcLayout(bool andRepaint) mLayoutType = wxTITLE_IMG_AND_TEXT; - wxNode* pNode = mTabs.First(); + wxNode* pNode = mTabs.GetFirst(); while( pNode ) { - twTabInfo& tab = *((twTabInfo*)(pNode->Data())); + twTabInfo& tab = *((twTabInfo*)(pNode->GetData())); wxWindowDC dc(this); @@ -1055,7 +1052,7 @@ void wxPagedWindow::RecalcLayout(bool andRepaint) tab.mDims.y = mTitleHeight; - pNode = pNode->Next(); + pNode = pNode->GetNext(); } // disable title-bar scroller if there's nowhere to scroll to @@ -1066,7 +1063,7 @@ void wxPagedWindow::RecalcLayout(bool andRepaint) //--------------------------------------------------------------------------- // event handlers //--------------------------------------------------------------------------- -void wxPagedWindow::OnPaint( wxPaintEvent& event ) +void wxPagedWindow::OnPaint( wxPaintEvent& WXUNUSED(event) ) { wxPaintDC dc(this); DrawDecorations( dc ); @@ -1097,7 +1094,7 @@ void wxPagedWindow::OnLButtonDown( wxMouseEvent& event ) } // wxPagedWindow::OnLButtonDown() //--------------------------------------------------------------------------- -void wxPagedWindow::OnLButtonUp( wxMouseEvent& event ) +void wxPagedWindow::OnLButtonUp( wxMouseEvent& WXUNUSED(event) ) { if ( mIsDragged ) { diff --git a/demos/dbbrowse/tabpgwin.h b/demos/dbbrowse/tabpgwin.h index 1237d628a8..da008ddefc 100644 --- a/demos/dbbrowse/tabpgwin.h +++ b/demos/dbbrowse/tabpgwin.h @@ -83,7 +83,7 @@ public: wxPen mDarkPen; // default: RGB(128,128,128) wxPen mBlackPen; // default: RGB( 0, 0, 0) - int mActiveTab; + size_t mActiveTab; int mTitleHeight; int mLayoutType; diff --git a/samples/db/dbtest.cpp b/samples/db/dbtest.cpp index 38345aacb4..36d2d2604b 100644 --- a/samples/db/dbtest.cpp +++ b/samples/db/dbtest.cpp @@ -91,324 +91,324 @@ void CheckSupportForAllDataTypes(wxDb *pDb) { wxString nativeDataTypeName; - wxLogMessage("\nThe following datatypes are supported by the\ndatabase you are currently connected to:"); + wxLogMessage(wxT("\nThe following datatypes are supported by the\ndatabase you are currently connected to:")); #ifdef SQL_C_BINARY if (DataTypeSupported(pDb,SQL_C_BINARY, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_BINARY (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_BINARY (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_BIT if (DataTypeSupported(pDb,SQL_C_BIT, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_BIT (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_BIT (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_BOOKMARK if (DataTypeSupported(pDb,SQL_C_BOOKMARK, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_BOOKMARK (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_BOOKMARK (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_CHAR if (DataTypeSupported(pDb,SQL_C_CHAR, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_CHAR (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_CHAR (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_DATE if (DataTypeSupported(pDb,SQL_C_DATE, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_DATE (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_DATE (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_DEFAULT if (DataTypeSupported(pDb,SQL_C_DEFAULT, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_DEFAULT (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_DEFAULT (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_DOUBLE if (DataTypeSupported(pDb,SQL_C_DOUBLE, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_DOUBLE (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_DOUBLE (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_FLOAT if (DataTypeSupported(pDb,SQL_C_FLOAT, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_FLOAT (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_FLOAT (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_GUID if (DataTypeSupported(pDb,SQL_C_GUID, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_GUID (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_GUID (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_INTERVAL_DAY if (DataTypeSupported(pDb,SQL_C_INTERVAL_DAY, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_INTERVAL_DAY (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_INTERVAL_DAY (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_INTERVAL_DAY_TO_HOUR if (DataTypeSupported(pDb,SQL_C_INTERVAL_DAY_TO_HOUR, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_INTERVAL_DAY_TO_HOUR (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_INTERVAL_DAY_TO_HOUR (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_INTERVAL_DAY_TO_MINUTE if (DataTypeSupported(pDb,SQL_C_INTERVAL_DAY_TO_MINUTE, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_INTERVAL_DAY_TO_MINUTE (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_INTERVAL_DAY_TO_MINUTE (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_INTERVAL_DAY_TO_SECOND if (DataTypeSupported(pDb,SQL_C_INTERVAL_DAY_TO_SECOND, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_INTERVAL_DAY_TO_SECOND (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_INTERVAL_DAY_TO_SECOND (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_INTERVAL_HOUR if (DataTypeSupported(pDb,SQL_C_INTERVAL_HOUR, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_INTERVAL_HOUR (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_INTERVAL_HOUR (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_INTERVAL_HOUR_TO_MINUTE if (DataTypeSupported(pDb,SQL_C_INTERVAL_HOUR_TO_MINUTE, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_INTERVAL_HOUR_TO_MINUTE (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_INTERVAL_HOUR_TO_MINUTE (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_INTERVAL_HOUR_TO_SECOND if (DataTypeSupported(pDb,SQL_C_INTERVAL_HOUR_TO_SECOND, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_INTERVAL_HOUR_TO_SECOND (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_INTERVAL_HOUR_TO_SECOND (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_INTERVAL_MINUTE if (DataTypeSupported(pDb,SQL_C_INTERVAL_MINUTE, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_INTERVAL_MINUTE (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_INTERVAL_MINUTE (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_INTERVAL_MINUTE_TO_SECOND if (DataTypeSupported(pDb,SQL_C_INTERVAL_MINUTE_TO_SECOND, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_INTERVAL_MINUTE_TO_SECOND (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_INTERVAL_MINUTE_TO_SECOND (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_INTERVAL_MONTH if (DataTypeSupported(pDb,SQL_C_INTERVAL_MONTH, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_INTERVAL_MONTH (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_INTERVAL_MONTH (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_INTERVAL_SECOND if (DataTypeSupported(pDb,SQL_C_INTERVAL_SECOND, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_INTERVAL_SECOND (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_INTERVAL_SECOND (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_INTERVAL_YEAR if (DataTypeSupported(pDb,SQL_C_INTERVAL_YEAR, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_INTERVAL_YEAR (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_INTERVAL_YEAR (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_INTERVAL_YEAR_TO_MONTH if (DataTypeSupported(pDb,SQL_C_INTERVAL_YEAR_TO_MONTH, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_INTERVAL_YEAR_TO_MONTH (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_INTERVAL_YEAR_TO_MONTH (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_LONG if (DataTypeSupported(pDb,SQL_C_LONG, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_LONG (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_LONG (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_NUMERIC if (DataTypeSupported(pDb,SQL_C_NUMERIC, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_NUMERIC (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_NUMERIC (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_SBIGINT if (DataTypeSupported(pDb,SQL_C_SBIGINT, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_SBIGINT (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_SBIGINT (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_SHORT if (DataTypeSupported(pDb,SQL_C_SHORT, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_SHORT (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_SHORT (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_SLONG if (DataTypeSupported(pDb,SQL_C_SLONG, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_SLONG (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_SLONG (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_SSHORT if (DataTypeSupported(pDb,SQL_C_SSHORT, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_SSHORT (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_SSHORT (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_STINYINT if (DataTypeSupported(pDb,SQL_C_STINYINT, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_STINYINT (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_STINYINT (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_TIME if (DataTypeSupported(pDb,SQL_C_TIME, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_TIME (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_TIME (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_TIMESTAMP if (DataTypeSupported(pDb,SQL_C_TIMESTAMP, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_TIMESTAMP (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_TIMESTAMP (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_TINYINT if (DataTypeSupported(pDb,SQL_C_TINYINT, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_TINYINT (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_TINYINT (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_TYPE_DATE if (DataTypeSupported(pDb,SQL_C_TYPE_DATE, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_TYPE_DATE (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_TYPE_DATE (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_TYPE_TIME if (DataTypeSupported(pDb,SQL_C_TYPE_TIME, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_TYPE_TIME (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_TYPE_TIME (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_TYPE_TIMESTAMP if (DataTypeSupported(pDb,SQL_C_TYPE_TIMESTAMP, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_TYPE_TIMESTAMP (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_TYPE_TIMESTAMP (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_UBIGINT if (DataTypeSupported(pDb,SQL_C_UBIGINT, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_UBIGINT (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_UBIGINT (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_ULONG if (DataTypeSupported(pDb,SQL_C_ULONG, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_ULONG (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_ULONG (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_USHORT if (DataTypeSupported(pDb,SQL_C_USHORT, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_USHORT (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_USHORT (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_UTINYINT if (DataTypeSupported(pDb,SQL_C_UTINYINT, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_UTINYINT (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_UTINYINT (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_C_VARBOOKMARK if (DataTypeSupported(pDb,SQL_C_VARBOOKMARK, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_VARBOOKMARK (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_VARBOOKMARK (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif @@ -417,96 +417,96 @@ void CheckSupportForAllDataTypes(wxDb *pDb) #ifdef SQL_DATE if (DataTypeSupported(pDb,SQL_DATE, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_DATE (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_DATE (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_INTERVAL if (DataTypeSupported(pDb,SQL_INTERVAL, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_INTERVAL (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_INTERVAL (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_TIME if (DataTypeSupported(pDb,SQL_TIME, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_TIME (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_TIME (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_TIMESTAMP if (DataTypeSupported(pDb,SQL_TIMESTAMP, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_TIMESTAMP (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_TIMESTAMP (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_LONGVARCHAR if (DataTypeSupported(pDb,SQL_LONGVARCHAR, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_LONGVARCHAR (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_LONGVARCHAR (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_BINARY if (DataTypeSupported(pDb,SQL_BINARY, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_BINARY (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_BINARY (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_VARBINARY if (DataTypeSupported(pDb,SQL_VARBINARY, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_VARBINARY (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_VARBINARY (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_LONGVARBINARY if (DataTypeSupported(pDb,SQL_LONGVARBINARY, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_LOGVARBINARY (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_LOGVARBINARY (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_BIGINT if (DataTypeSupported(pDb,SQL_BIGINT, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_BIGINT (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_BIGINT (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_TINYINT if (DataTypeSupported(pDb,SQL_TINYINT, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_TINYINT (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_TINYINT (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_BIT if (DataTypeSupported(pDb,SQL_BIT, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_BIT (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_BIT (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_GUID if (DataTypeSupported(pDb,SQL_GUID, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_GUID (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_GUID (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif @@ -514,80 +514,80 @@ void CheckSupportForAllDataTypes(wxDb *pDb) #ifdef SQL_CHAR if (DataTypeSupported(pDb,SQL_CHAR, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_CHAR (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_CHAR (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_INTEGER if (DataTypeSupported(pDb,SQL_INTEGER, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_INTEGER (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_INTEGER (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_SMALLINT if (DataTypeSupported(pDb,SQL_SMALLINT, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_SAMLLINT (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_SAMLLINT (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_REAL if (DataTypeSupported(pDb,SQL_REAL, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_REAL (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_REAL (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_DOUBLE if (DataTypeSupported(pDb,SQL_DOUBLE, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_DOUBLE (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_DOUBLE (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_NUMERIC if (DataTypeSupported(pDb,SQL_NUMERIC, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_NUMERIC (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_NUMERIC (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_DATE if (DataTypeSupported(pDb,SQL_DATE, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_DATE (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_DATE (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_TIME if (DataTypeSupported(pDb,SQL_TIME, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_TIME (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_TIME (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_TIMESTAMP if (DataTypeSupported(pDb,SQL_TIMESTAMP, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_TIMESTAMP (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_TIMESTAMP (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif #ifdef SQL_VARCHAR if (DataTypeSupported(pDb,SQL_VARCHAR, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_VARCHAR (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_VARCHAR (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif @@ -596,13 +596,13 @@ void CheckSupportForAllDataTypes(wxDb *pDb) #ifdef SQL_C_TCHAR if (DataTypeSupported(pDb,SQL_C_TCHAR, &nativeDataTypeName)) { - nativeDataTypeName = "SQL_C_TCHAR (" + nativeDataTypeName; - nativeDataTypeName += ")"; + nativeDataTypeName = wxT("SQL_C_TCHAR (") + nativeDataTypeName; + nativeDataTypeName += wxT(")"); wxLogMessage(nativeDataTypeName); } #endif - wxLogMessage("\n"); + wxLogMessage(wxT("\n")); } // CheckSupportForAllDataTypes() @@ -619,7 +619,7 @@ bool DatabaseDemoApp::OnInit() // Make a menubar wxMenu *file_menu = new wxMenu; - file_menu->Append(FILE_CREATE, wxT("&Create CONTACT table")); + file_menu->Append(FILE_CREATE_ID, wxT("&Create CONTACT table")); file_menu->Append(FILE_RECREATE_TABLE, wxT("&Recreate CONTACT table")); file_menu->Append(FILE_RECREATE_INDEXES, wxT("&Recreate CONTACT indexes")); #if wxUSE_NEW_GRID @@ -699,11 +699,11 @@ bool DatabaseDemoApp::OnInit() /* * Remove CR or CR/LF from a character string. */ -char* wxRemoveLineTerminator(char* aString) +wxChar* wxRemoveLineTerminator(wxChar* aString) { - int len = strlen(aString); - while (len > 0 && (aString[len-1] == '\r' || aString[len-1] == '\n')) { - aString[len-1] = '\0'; + int len = wxStrlen(aString); + while (len > 0 && (aString[len-1] == wxT('\r') || aString[len-1] == wxT('\n'))) { + aString[len-1] = wxT('\0'); len--; } return aString; @@ -713,7 +713,7 @@ char* wxRemoveLineTerminator(char* aString) bool DatabaseDemoApp::ReadParamFile(Cparameters ¶ms) { FILE *paramFile; - if ((paramFile = fopen(PARAM_FILENAME, wxT("r"))) == NULL) + if ((paramFile = wxFopen(PARAM_FILENAME, wxT("r"))) == NULL) { wxString tStr; tStr.Printf(wxT("Unable to open the parameter file '%s' for reading.\n\nYou must specify the data source, user name, and\npassword that will be used and save those settings."),PARAM_FILENAME); @@ -723,19 +723,19 @@ bool DatabaseDemoApp::ReadParamFile(Cparameters ¶ms) } wxChar buffer[1000+1]; - fgets(buffer, sizeof(params.ODBCSource), paramFile); + wxFgets(buffer, sizeof(params.ODBCSource), paramFile); wxRemoveLineTerminator(buffer); wxStrcpy(params.ODBCSource,buffer); - fgets(buffer, sizeof(params.UserName), paramFile); + wxFgets(buffer, sizeof(params.UserName), paramFile); wxRemoveLineTerminator(buffer); wxStrcpy(params.UserName,buffer); - fgets(buffer, sizeof(params.Password), paramFile); + wxFgets(buffer, sizeof(params.Password), paramFile); wxRemoveLineTerminator(buffer); wxStrcpy(params.Password,buffer); - fgets(buffer, sizeof(params.DirPath), paramFile); + wxFgets(buffer, sizeof(params.DirPath), paramFile); wxRemoveLineTerminator(buffer); wxStrcpy(params.DirPath,buffer); @@ -745,10 +745,10 @@ bool DatabaseDemoApp::ReadParamFile(Cparameters ¶ms) } // DatabaseDemoApp::ReadParamFile() -bool DatabaseDemoApp::WriteParamFile(Cparameters ¶ms) +bool DatabaseDemoApp::WriteParamFile(Cparameters &WXUNUSED(params)) { FILE *paramFile; - if ((paramFile = fopen(PARAM_FILENAME, wxT("wt"))) == NULL) + if ((paramFile = wxFopen(PARAM_FILENAME, wxT("wt"))) == NULL) { wxString tStr; tStr.Printf(wxT("Unable to write/overwrite '%s'."),PARAM_FILENAME); @@ -756,14 +756,14 @@ bool DatabaseDemoApp::WriteParamFile(Cparameters ¶ms) return FALSE; } - fputs(wxGetApp().params.ODBCSource, paramFile); - fputc(wxT('\n'), paramFile); - fputs(wxGetApp().params.UserName, paramFile); - fputc(wxT('\n'), paramFile); - fputs(wxGetApp().params.Password, paramFile); - fputc(wxT('\n'), paramFile); - fputs(wxGetApp().params.DirPath, paramFile); - fputc(wxT('\n'), paramFile); + wxFputs(wxGetApp().params.ODBCSource, paramFile); + wxFputc(wxT('\n'), paramFile); + wxFputs(wxGetApp().params.UserName, paramFile); + wxFputc(wxT('\n'), paramFile); + wxFputs(wxGetApp().params.Password, paramFile); + wxFputc(wxT('\n'), paramFile); + wxFputs(wxGetApp().params.DirPath, paramFile); + wxFputc(wxT('\n'), paramFile); fclose(paramFile); return TRUE; @@ -790,7 +790,7 @@ void DatabaseDemoApp::CreateDataTable(bool recreate) wxEndBusyCursor(); wxString tStr; tStr = wxT("Error creating CONTACTS table.\nTable was not created.\n\n"); - wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),Contact->GetDb(),__FILE__,__LINE__), + wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),Contact->GetDb(),__TFILE__,__LINE__), wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION); success = FALSE; @@ -802,7 +802,7 @@ void DatabaseDemoApp::CreateDataTable(bool recreate) wxEndBusyCursor(); wxString tStr; tStr = wxT("Error creating CONTACTS indexes.\nIndexes will be unavailable.\n\n"); - wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),Contact->GetDb(),__FILE__,__LINE__), + wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),Contact->GetDb(),__TFILE__,__LINE__), wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION); success = FALSE; @@ -817,7 +817,7 @@ void DatabaseDemoApp::CreateDataTable(bool recreate) BEGIN_EVENT_TABLE(DatabaseDemoFrame, wxFrame) - EVT_MENU(FILE_CREATE, DatabaseDemoFrame::OnCreate) + EVT_MENU(FILE_CREATE_ID, DatabaseDemoFrame::OnCreate) EVT_MENU(FILE_RECREATE_TABLE, DatabaseDemoFrame::OnRecreateTable) EVT_MENU(FILE_RECREATE_INDEXES, DatabaseDemoFrame::OnRecreateIndexes) #if wxUSE_NEW_GRID @@ -849,19 +849,19 @@ DatabaseDemoFrame::~DatabaseDemoFrame() } // DatabaseDemoFrame destructor -void DatabaseDemoFrame::OnCreate(wxCommandEvent& event) +void DatabaseDemoFrame::OnCreate(wxCommandEvent& WXUNUSED(event)) { wxGetApp().CreateDataTable(FALSE); } // DatabaseDemoFrame::OnCreate() -void DatabaseDemoFrame::OnRecreateTable(wxCommandEvent& event) +void DatabaseDemoFrame::OnRecreateTable(wxCommandEvent& WXUNUSED(event)) { wxGetApp().CreateDataTable(TRUE); } // DatabaseDemoFrame::OnRecreate() -void DatabaseDemoFrame::OnRecreateIndexes(wxCommandEvent& event) +void DatabaseDemoFrame::OnRecreateIndexes(wxCommandEvent& WXUNUSED(event)) { wxGetApp().Contact->GetDb()->RollbackTrans(); // Make sure the current cursor is in a known/stable state @@ -871,7 +871,7 @@ void DatabaseDemoFrame::OnRecreateIndexes(wxCommandEvent& event) wxEndBusyCursor(); wxString tStr; tStr = wxT("Error creating CONTACTS indexes.\nNew indexes will be unavailable.\n\n"); - wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__FILE__,__LINE__), + wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__TFILE__,__LINE__), wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION); } @@ -882,7 +882,7 @@ void DatabaseDemoFrame::OnRecreateIndexes(wxCommandEvent& event) #if wxUSE_NEW_GRID -void DatabaseDemoFrame::OnDbGridTable(wxCommandEvent& ) +void DatabaseDemoFrame::OnDbGridTable(wxCommandEvent& WXUNUSED(event)) { DbGridFrame *frame = new DbGridFrame(this); if (frame->Initialize()) @@ -892,13 +892,13 @@ void DatabaseDemoFrame::OnDbGridTable(wxCommandEvent& ) } #endif -void DatabaseDemoFrame::OnExit(wxCommandEvent& event) +void DatabaseDemoFrame::OnExit(wxCommandEvent& WXUNUSED(event)) { Close(); } // DatabaseDemoFrame::OnExit() -void DatabaseDemoFrame::OnEditParameters(wxCommandEvent& event) +void DatabaseDemoFrame::OnEditParameters(wxCommandEvent& WXUNUSED(event)) { if ((pEditorDlg->mode != mCreate) && (pEditorDlg->mode != mEdit)) BuildParameterDialog(this); @@ -907,7 +907,7 @@ void DatabaseDemoFrame::OnEditParameters(wxCommandEvent& event) } // DatabaseDemoFrame::OnEditParameters() -void DatabaseDemoFrame::OnAbout(wxCommandEvent& event) +void DatabaseDemoFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxMessageBox(wxT("wxWindows sample program for database classes\n\nContributed on 27 July 1998"),wxT("About..."),wxOK | wxICON_INFORMATION); } // DatabaseDemoFrame::OnAbout() @@ -1039,7 +1039,7 @@ Ccontact::~Ccontact() wxString tStr; tStr = wxT("Unable to Free the Ccontact data table handle\n\n"); - wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__FILE__,__LINE__), + wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__TFILE__,__LINE__), wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION); } } @@ -1082,14 +1082,14 @@ bool Ccontact::CreateIndexes(bool recreate) bool Ok = TRUE; - wxStrcpy(idxDef[0].ColName, "IS_DEV"); + wxStrcpy(idxDef[0].ColName, wxT("IS_DEV")); idxDef[0].Ascending = TRUE; - wxStrcpy(idxDef[1].ColName, "NAME"); + wxStrcpy(idxDef[1].ColName, wxT("NAME")); idxDef[1].Ascending = TRUE; indexName = GetTableName(); - indexName += "_IDX1"; + indexName += wxT("_IDX1"); Ok = CreateIndex(indexName.c_str(), TRUE, 2, idxDef, recreate); return Ok; @@ -1174,7 +1174,7 @@ void CeditorDlg::OnButton(wxCommandEvent &event) } // CeditorDlg::OnButton() -void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event) +void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& WXUNUSED(event)) { wxString widgetName; @@ -1295,7 +1295,7 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event) { wxString tStr; tStr = wxT("ODBC error during Query()\n\n"); - wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__FILE__,__LINE__), + wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__TFILE__,__LINE__), wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION); SetMode(mView); @@ -1341,7 +1341,7 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event) if (wxStrcmp(qryWhere, (const wxChar*) wxGetApp().Contact->qryWhereStr)) { wxGetApp().Contact->whereStr.Empty(); - wxGetApp().Contact->SetOrderByClause("NAME"); + wxGetApp().Contact->SetOrderByClause(wxT("NAME")); if (wxGetApp().Contact->GetDb()->Dbms() != dbmsPOSTGRES && wxGetApp().Contact->GetDb()->Dbms() != dbmsMY_SQL) @@ -1365,7 +1365,7 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event) { wxString tStr; tStr = wxT("ODBC error during Query()\n\n"); - wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__FILE__,__LINE__), + wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__TFILE__,__LINE__), wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION); return; @@ -1402,7 +1402,7 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event) { wxString tStr; tStr = wxT("ODBC error during Query()\n\n"); - wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__FILE__,__LINE__), + wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__TFILE__,__LINE__), wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION); return; } @@ -1442,23 +1442,23 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event) if (widgetName == pDataTypesBtn->GetName()) { CheckSupportForAllDataTypes(wxGetApp().READONLY_DB); - wxMessageBox("Support datatypes was dumped to stdout."); + wxMessageBox(wxT("Support datatypes was dumped to stdout.")); return; } // Data types Button if (widgetName == pDbDiagsBtn->GetName()) { DisplayDbDiagnostics(wxGetApp().READONLY_DB); - wxMessageBox("Diagnostics info was dumped to stdout."); + wxMessageBox(wxT("Diagnostics info was dumped to stdout.")); return; } if (widgetName == pCatalogBtn->GetName()) { - if (wxGetApp().Contact->GetDb()->Catalog("","catalog.txt")) - wxMessageBox("The file 'catalog.txt' was created."); + if (wxGetApp().Contact->GetDb()->Catalog(wxT(""),wxT("catalog.txt"))) + wxMessageBox(wxT("The file 'catalog.txt' was created.")); else - wxMessageBox("Creation of the file 'catalog.txt' was failed."); + wxMessageBox(wxT("Creation of the file 'catalog.txt' was failed.")); return; } @@ -1516,7 +1516,7 @@ bool CeditorDlg::Initialize() wxString tStr; tStr.Printf(wxT("Unable to open the table '%s' (likely due to\ninsufficient privileges of the logged in user).\n\n"),CONTACT_TABLE_NAME); - wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__FILE__,__LINE__), + wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__TFILE__,__LINE__), wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION); } else @@ -1527,7 +1527,7 @@ bool CeditorDlg::Initialize() { wxString tStr; tStr.Printf(wxT("Unable to open the table '%s' as the table\ndoes not appear to exist in the tablespace available\nto the currently logged in user.\n\n"),CONTACT_TABLE_NAME); - wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__FILE__,__LINE__), + wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__TFILE__,__LINE__), wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION); } @@ -1626,7 +1626,7 @@ bool CeditorDlg::Initialize() { wxString tStr; tStr = wxT("ODBC error during Query()\n\n"); - wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__FILE__,__LINE__), + wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__TFILE__,__LINE__), wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION); return FALSE; } @@ -1773,9 +1773,9 @@ bool CeditorDlg::GetData() first = tStr.First(wxT('/')); second = tStr.Last(wxT('/')); - mm = atoi(tStr.SubString(0,first)); - dd = atoi(tStr.SubString(first+1,second)); - yyyy = atoi(tStr.SubString(second+1,tStr.Length()-1)); + mm = wxAtoi(tStr.SubString(0,first)); + dd = wxAtoi(tStr.SubString(first+1,second)); + yyyy = wxAtoi(tStr.SubString(second+1,tStr.Length()-1)); invalid = !(mm && dd && yyyy); } @@ -1833,8 +1833,8 @@ bool CeditorDlg::GetData() wxStrcpy(wxGetApp().Contact->Country,pCountryTxt->GetValue()); wxStrcpy(wxGetApp().Contact->PostalCode,pPostalCodeTxt->GetValue()); - wxGetApp().Contact->Contributions = atoi(pContribTxt->GetValue()); - wxGetApp().Contact->LinesOfCode = atol(pLinesTxt->GetValue()); + wxGetApp().Contact->Contributions = wxAtoi(pContribTxt->GetValue()); + wxGetApp().Contact->LinesOfCode = wxAtol(pLinesTxt->GetValue()); wxGetApp().Contact->NativeLanguage = (enum Language) pNativeLangChoice->GetSelection(); wxGetApp().Contact->IsDeveloper = pDeveloperRadio->GetSelection() > 0; @@ -1878,7 +1878,7 @@ bool CeditorDlg::Save() { wxString tStr; tStr = wxT("A duplicate key value already exists in the table.\nUnable to save record\n\n"); - wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__FILE__,__LINE__), + wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__TFILE__,__LINE__), wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION); } else @@ -1886,7 +1886,7 @@ bool CeditorDlg::Save() // Some other unexpected error occurred wxString tStr; tStr = wxT("Database insert failed\n\n"); - wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__FILE__,__LINE__), + wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__TFILE__,__LINE__), wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION); } } @@ -1894,12 +1894,12 @@ bool CeditorDlg::Save() else // mode == mEdit { wxGetApp().Contact->GetDb()->RollbackTrans(); - wxGetApp().Contact->whereStr.Printf("NAME = '%s'",saveName.c_str()); + wxGetApp().Contact->whereStr.Printf(wxT("NAME = '%s'"),saveName.c_str()); if (!wxGetApp().Contact->UpdateWhere(wxGetApp().Contact->whereStr)) { wxString tStr; tStr = wxT("Database update failed\n\n"); - wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__FILE__,__LINE__), + wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__TFILE__,__LINE__), wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION); failed = TRUE; } @@ -2006,7 +2006,7 @@ bool CeditorDlg::GetRec(const wxString &whereStr) { wxString tStr; tStr = wxT("ODBC error during Query()\n\n"); - wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__FILE__,__LINE__), + wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__TFILE__,__LINE__), wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION); return(FALSE); @@ -2101,7 +2101,7 @@ void CparameterDlg::OnButton( wxCommandEvent &event ) } -void CparameterDlg::OnCommand(wxWindow& win, wxCommandEvent& event) +void CparameterDlg::OnCommand(wxWindow& win, wxCommandEvent& WXUNUSED(event)) { wxString widgetName; @@ -2320,7 +2320,7 @@ CqueryDlg::CqueryDlg(wxWindow *parent, wxDb *pDb, wxChar *tblName[], wxEndBusyCursor(); wxString tStr; tStr = wxT("ODBC error during GetColumns()\n\n"); - wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__FILE__,__LINE__), + wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__TFILE__,__LINE__), wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION); return; } @@ -2374,7 +2374,7 @@ void CqueryDlg::OnButton(wxCommandEvent &event) } // CqueryDlg::OnButton() -void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event) +void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& WXUNUSED(event)) { // Widget pointers won't be set when the dialog is constructed. // Control is passed through this function once for each widget on @@ -2577,7 +2577,7 @@ void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event) } // CqueryDlg::OnCommand -void CqueryDlg::OnCloseWindow(wxCloseEvent& event) +void CqueryDlg::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) { // Clean up wxDELETEA(colInf); @@ -2723,7 +2723,7 @@ void CqueryDlg::ProcessCountBtn() { wxString tStr; tStr = wxT("ODBC error during Open()\n\n"); - wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__FILE__,__LINE__), + wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__TFILE__,__LINE__), wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION); return; } @@ -2789,54 +2789,54 @@ void DisplayDbDiagnostics(wxDb *pDb) s = langDBINF_DB_NAME; s += pDb->dbInf.dbmsName; - s += "\n"; + s += wxT("\n"); s += langDBINF_DB_VER; s += pDb->dbInf.dbmsVer; - s += "\n"; + s += wxT("\n"); s += langDBINF_DRIVER_NAME; s += pDb->dbInf.driverName; - s += "\n"; + s += wxT("\n"); s += langDBINF_DRIVER_ODBC_VER; s += pDb->dbInf.odbcVer; - s += "\n"; + s += wxT("\n"); s += langDBINF_DRIVER_MGR_ODBC_VER; s += pDb->dbInf.drvMgrOdbcVer; - s += "\n"; + s += wxT("\n"); s += langDBINF_DRIVER_VER; s += pDb->dbInf.driverVer; - s += "\n"; + s += wxT("\n"); s += langDBINF_SERVER_NAME; s += pDb->dbInf.serverName; - s += "\n"; + s += wxT("\n"); s += langDBINF_FILENAME; s += pDb->dbInf.databaseName; - s += "\n"; + s += wxT("\n"); s += langDBINF_OUTER_JOINS; s += pDb->dbInf.outerJoins; - s += "\n"; + s += wxT("\n"); s += langDBINF_STORED_PROC; s += pDb->dbInf.procedureSupport; - s += "\n"; + s += wxT("\n"); if (pDb->dbInf.maxConnections) - t.sprintf("%s%d\n", langDBINF_MAX_HDBC, pDb->dbInf.maxConnections); + t.sprintf(wxT("%s%d\n"), langDBINF_MAX_HDBC, pDb->dbInf.maxConnections); else - t.sprintf("%s%s\n", langDBINF_MAX_HDBC, langDBINF_UNLIMITED); + t.sprintf(wxT("%s%s\n"), langDBINF_MAX_HDBC, langDBINF_UNLIMITED); s += t; if (pDb->dbInf.maxStmts) - t.sprintf("%s%d\n", langDBINF_MAX_HSTMT, pDb->dbInf.maxStmts); + t.sprintf(wxT("%s%d\n"), langDBINF_MAX_HSTMT, pDb->dbInf.maxStmts); else - t.sprintf("%s%s\n", langDBINF_MAX_HSTMT, langDBINF_UNLIMITED); + t.sprintf(wxT("%s%s\n"), langDBINF_MAX_HSTMT, langDBINF_UNLIMITED); s += t; s += langDBINF_API_LVL; @@ -2846,7 +2846,7 @@ void DisplayDbDiagnostics(wxDb *pDb) case SQL_OAC_LEVEL1: s += langDBINF_LEVEL1; break; case SQL_OAC_LEVEL2: s += langDBINF_LEVEL2; break; } - s += "\n"; + s += wxT("\n"); s += langDBINF_CLI_LVL; switch(pDb->dbInf.cliConfLvl) @@ -2854,7 +2854,7 @@ void DisplayDbDiagnostics(wxDb *pDb) case SQL_OSCC_NOT_COMPLIANT: s += langDBINF_NOT_COMPLIANT; break; case SQL_OSCC_COMPLIANT: s += langDBINF_COMPLIANT; break; } - s += "\n"; + s += wxT("\n"); s += langDBINF_SQL_LVL; switch(pDb->dbInf.sqlConfLvl) @@ -2863,7 +2863,7 @@ void DisplayDbDiagnostics(wxDb *pDb) case SQL_OSC_CORE: s += langDBINF_CORE_GRAMMAR; break; case SQL_OSC_EXTENDED: s += langDBINF_EXT_GRAMMAR; break; } - s += "\n"; + s += wxT("\n"); s += langDBINF_COMMIT_BEHAVIOR; switch(pDb->dbInf.cursorCommitBehavior) @@ -2872,7 +2872,7 @@ void DisplayDbDiagnostics(wxDb *pDb) case SQL_CB_CLOSE: s += langDBINF_CLOSE_CURSORS; break; case SQL_CB_PRESERVE: s += langDBINF_PRESERVE_CURSORS; break; } - s += "\n"; + s += wxT("\n"); s += langDBINF_ROLLBACK_BEHAVIOR; switch(pDb->dbInf.cursorRollbackBehavior) @@ -2881,7 +2881,7 @@ void DisplayDbDiagnostics(wxDb *pDb) case SQL_CB_CLOSE: s += langDBINF_CLOSE_CURSORS; break; case SQL_CB_PRESERVE: s += langDBINF_PRESERVE_CURSORS; break; } - s += "\n"; + s += wxT("\n"); s += langDBINF_SUPP_NOT_NULL; switch(pDb->dbInf.supportNotNullClause) @@ -2889,11 +2889,11 @@ void DisplayDbDiagnostics(wxDb *pDb) case SQL_NNC_NULL: s += langNO; break; case SQL_NNC_NON_NULL: s += langYES; break; } - s += "\n"; + s += wxT("\n"); s += langDBINF_SUPP_IEF; s += pDb->dbInf.supportIEF; - s += "\n"; + s += wxT("\n"); // DEFAULT setting for "Transaction Isolation Level" s += langDBINF_TXN_ISOLATION; @@ -2907,7 +2907,7 @@ void DisplayDbDiagnostics(wxDb *pDb) case SQL_TXN_VERSIONING: s += langDBINF_VERSIONING; break; #endif } - s += "\n"; + s += wxT("\n"); // CURRENT setting for "Transaction Isolation Level" long txnIsoLvl; @@ -2925,7 +2925,7 @@ void DisplayDbDiagnostics(wxDb *pDb) #endif } } - s += "\n"; + s += wxT("\n"); #ifdef __VMS__ #pragma message disable incboodep @@ -2935,108 +2935,108 @@ void DisplayDbDiagnostics(wxDb *pDb) if (pDb->dbInf.txnIsolationOptions & SQL_TXN_READ_UNCOMMITTED) {s += langDBINF_READ_UNCOMMITTED; comma++;} if (pDb->dbInf.txnIsolationOptions & SQL_TXN_READ_COMMITTED) - {if (comma++) s += ", "; s += langDBINF_READ_COMMITTED;} + {if (comma++) s += wxT(", "); s += langDBINF_READ_COMMITTED;} if (pDb->dbInf.txnIsolationOptions & SQL_TXN_REPEATABLE_READ) - {if (comma++) s += ", "; s += langDBINF_REPEATABLE_READ;} + {if (comma++) s += wxT(", "); s += langDBINF_REPEATABLE_READ;} if (pDb->dbInf.txnIsolationOptions & SQL_TXN_SERIALIZABLE) - {if (comma++) s += ", "; s += langDBINF_SERIALIZABLE;} + {if (comma++) s += wxT(", "); s += langDBINF_SERIALIZABLE;} #ifdef ODBC_V20 if (pDb->dbInf.txnIsolationOptions & SQL_TXN_VERSIONING) - {if (comma++) s += ", "; s += langDBINF_VERSIONING;} + {if (comma++) s += wxT(", "); s += langDBINF_VERSIONING;} #endif - s += "\n"; + s += wxT("\n"); comma = FALSE; s += langDBINF_FETCH_DIRS; if (pDb->dbInf.fetchDirections & SQL_FD_FETCH_NEXT) {s += langDBINF_NEXT; comma++;} if (pDb->dbInf.fetchDirections & SQL_FD_FETCH_PRIOR) - {if (comma++) s += ", "; s += langDBINF_PREV;} + {if (comma++) s += wxT(", "); s += langDBINF_PREV;} if (pDb->dbInf.fetchDirections & SQL_FD_FETCH_FIRST) - {if (comma++) s += ", "; s += langDBINF_FIRST;} + {if (comma++) s += wxT(", "); s += langDBINF_FIRST;} if (pDb->dbInf.fetchDirections & SQL_FD_FETCH_LAST) - {if (comma++) s += ", "; s += langDBINF_LAST;} + {if (comma++) s += wxT(", "); s += langDBINF_LAST;} if (pDb->dbInf.fetchDirections & SQL_FD_FETCH_ABSOLUTE) - {if (comma++) s += ", "; s += langDBINF_ABSOLUTE;} + {if (comma++) s += wxT(", "); s += langDBINF_ABSOLUTE;} if (pDb->dbInf.fetchDirections & SQL_FD_FETCH_RELATIVE) - {if (comma++) s += ", "; s += langDBINF_RELATIVE;} + {if (comma++) s += wxT(", "); s += langDBINF_RELATIVE;} #ifdef ODBC_V20 if (pDb->dbInf.fetchDirections & SQL_FD_FETCH_RESUME) - {if (comma++) s += ", "; s += langDBINF_RESUME;} + {if (comma++) s += wxT(", "); s += langDBINF_RESUME;} #endif if (pDb->dbInf.fetchDirections & SQL_FD_FETCH_BOOKMARK) - {if (comma++) s += ", "; s += langDBINF_BOOKMARK;} - s += "\n"; + {if (comma++) s += wxT(", "); s += langDBINF_BOOKMARK;} + s += wxT("\n"); comma = FALSE; s += langDBINF_LOCK_TYPES; if (pDb->dbInf.lockTypes & SQL_LCK_NO_CHANGE) {s += langDBINF_NO_CHANGE; comma++;} if (pDb->dbInf.lockTypes & SQL_LCK_EXCLUSIVE) - {if (comma++) s += ", "; s += langDBINF_EXCLUSIVE;} + {if (comma++) s += wxT(", "); s += langDBINF_EXCLUSIVE;} if (pDb->dbInf.lockTypes & SQL_LCK_UNLOCK) - {if (comma++) s += ", "; s += langDBINF_UNLOCK;} - s += "\n"; + {if (comma++) s += wxT(", "); s += langDBINF_UNLOCK;} + s += wxT("\n"); comma = FALSE; s += langDBINF_POS_OPERS; if (pDb->dbInf.posOperations & SQL_POS_POSITION) {s += langDBINF_POSITION; comma++;} if (pDb->dbInf.posOperations & SQL_POS_REFRESH) - {if (comma++) s += ", "; s += langDBINF_REFRESH;} + {if (comma++) s += wxT(", "); s += langDBINF_REFRESH;} if (pDb->dbInf.posOperations & SQL_POS_UPDATE) - {if (comma++) s += ", "; s += langDBINF_UPD;} + {if (comma++) s += wxT(", "); s += langDBINF_UPD;} if (pDb->dbInf.posOperations & SQL_POS_DELETE) - {if (comma++) s += ", "; s += langDBINF_DEL;} + {if (comma++) s += wxT(", "); s += langDBINF_DEL;} if (pDb->dbInf.posOperations & SQL_POS_ADD) - {if (comma++) s += ", "; s += langDBINF_ADD;} - s += "\n"; + {if (comma++) s += wxT(", "); s += langDBINF_ADD;} + s += wxT("\n"); comma = FALSE; s += langDBINF_POS_STMTS; if (pDb->dbInf.posStmts & SQL_PS_POSITIONED_DELETE) {s += langDBINF_POS_DEL; comma++;} if (pDb->dbInf.posStmts & SQL_PS_POSITIONED_UPDATE) - {if (comma++) s += ", "; s += langDBINF_POS_UPD;} + {if (comma++) s += wxT(", "); s += langDBINF_POS_UPD;} if (pDb->dbInf.posStmts & SQL_PS_SELECT_FOR_UPDATE) - {if (comma++) s += ", "; s += langDBINF_SELECT_FOR_UPD;} - s += "\n"; + {if (comma++) s += wxT(", "); s += langDBINF_SELECT_FOR_UPD;} + s += wxT("\n"); comma = FALSE; s += langDBINF_SCROLL_CONCURR; if (pDb->dbInf.scrollConcurrency & SQL_SCCO_READ_ONLY) {s += langDBINF_READ_ONLY; comma++;} if (pDb->dbInf.scrollConcurrency & SQL_SCCO_LOCK) - {if (comma++) s += ", "; s += langDBINF_LOCK;} + {if (comma++) s += wxT(", "); s += langDBINF_LOCK;} if (pDb->dbInf.scrollConcurrency & SQL_SCCO_OPT_ROWVER) - {if (comma++) s += ", "; s += langDBINF_OPT_ROWVER;} + {if (comma++) s += wxT(", "); s += langDBINF_OPT_ROWVER;} if (pDb->dbInf.scrollConcurrency & SQL_SCCO_OPT_VALUES) - {if (comma++) s += ", "; s += langDBINF_OPT_VALUES;} - s += "\n"; + {if (comma++) s += wxT(", "); s += langDBINF_OPT_VALUES;} + s += wxT("\n"); comma = FALSE; s += langDBINF_SCROLL_OPTS; if (pDb->dbInf.scrollOptions & SQL_SO_FORWARD_ONLY) {s += langDBINF_FWD_ONLY; comma++;} if (pDb->dbInf.scrollOptions & SQL_SO_STATIC) - {if (comma++) s += ", "; s += langDBINF_STATIC;} + {if (comma++) s += wxT(", "); s += langDBINF_STATIC;} if (pDb->dbInf.scrollOptions & SQL_SO_KEYSET_DRIVEN) - {if (comma++) s += ", "; s += langDBINF_KEYSET_DRIVEN;} + {if (comma++) s += wxT(", "); s += langDBINF_KEYSET_DRIVEN;} if (pDb->dbInf.scrollOptions & SQL_SO_DYNAMIC) - {if (comma++) s += ", "; s += langDBINF_DYNAMIC;} + {if (comma++) s += wxT(", "); s += langDBINF_DYNAMIC;} if (pDb->dbInf.scrollOptions & SQL_SO_MIXED) - {if (comma++) s += ", "; s += langDBINF_MIXED;} - s += "\n"; + {if (comma++) s += wxT(", "); s += langDBINF_MIXED;} + s += wxT("\n"); comma = FALSE; s += langDBINF_STATIC_SENS; if (pDb->dbInf.staticSensitivity & SQL_SS_ADDITIONS) {s += langDBINF_ADDITIONS; comma++;} if (pDb->dbInf.staticSensitivity & SQL_SS_DELETIONS) - {if (comma++) s += ", "; s += langDBINF_DELETIONS;} + {if (comma++) s += wxT(", "); s += langDBINF_DELETIONS;} if (pDb->dbInf.staticSensitivity & SQL_SS_UPDATES) - {if (comma++) s += ", "; s += langDBINF_UPDATES;} - s += "\n"; + {if (comma++) s += wxT(", "); s += langDBINF_UPDATES;} + s += wxT("\n"); #ifdef __VMS__ #pragma message enable incboodep #endif @@ -3051,69 +3051,69 @@ void DisplayDbDiagnostics(wxDb *pDb) case SQL_TC_DDL_IGNORE: s += langDBINF_DDL_IGNORE; break; case SQL_TC_ALL: s += langDBINF_DDL_AND_DML; break; } - s += "\n"; + s += wxT("\n"); - t.sprintf("%s%d\n", langDBINF_LOGIN_TIMEOUT, pDb->dbInf.loginTimeout); + t.sprintf(wxT("%s%lu\n"), langDBINF_LOGIN_TIMEOUT, pDb->dbInf.loginTimeout); s += t; // Oracle specific information if (pDb->Dbms() == dbmsORACLE) { - s += "\n"; + s += wxT("\n"); s += langDBINF_ORACLE_BANNER; - s += "\n"; + s += wxT("\n"); // Oracle cache hit ratio SDWORD cb; ULONG dbBlockGets; - pDb->ExecSql("SELECT VALUE FROM V$SYSSTAT WHERE NAME = 'db block gets'"); + pDb->ExecSql(wxT("SELECT VALUE FROM V$SYSSTAT WHERE NAME = 'db block gets'")); pDb->GetNext(); if (pDb->GetData(1, SQL_C_ULONG, &dbBlockGets, 0, &cb)) { - t.sprintf("%s: %lu\n", langDBINF_DB_BLOCK_GETS, dbBlockGets); + t.sprintf(wxT("%s: %lu\n"), langDBINF_DB_BLOCK_GETS, dbBlockGets); s += t; } ULONG consistentGets; - pDb->ExecSql("SELECT VALUE FROM V$SYSSTAT WHERE NAME = 'consistent gets'"); + pDb->ExecSql(wxT("SELECT VALUE FROM V$SYSSTAT WHERE NAME = 'consistent gets'")); pDb->GetNext(); if (pDb->GetData(1, SQL_C_ULONG, &consistentGets, 0, &cb)) { - t.sprintf("%s: %lu\n", langDBINF_CONSISTENT_GETS, consistentGets); + t.sprintf(wxT("%s: %lu\n"), langDBINF_CONSISTENT_GETS, consistentGets); s += t; } ULONG physReads; - pDb->ExecSql("SELECT VALUE FROM V$SYSSTAT WHERE NAME = 'physical reads'"); + pDb->ExecSql(wxT("SELECT VALUE FROM V$SYSSTAT WHERE NAME = 'physical reads'")); pDb->GetNext(); if (pDb->GetData(1, SQL_C_ULONG, &physReads, 0, &cb)) { - t.sprintf("%s: %lu\n", langDBINF_PHYSICAL_READS, physReads); + t.sprintf(wxT("%s: %lu\n"), langDBINF_PHYSICAL_READS, physReads); s += t; } ULONG hitRatio = (ULONG)((1.00 - ((float)physReads / (float)(dbBlockGets + consistentGets))) * 100.00); - t.sprintf("*** %s: %lu%%\n", langDBINF_CACHE_HIT_RATIO, hitRatio); + t.sprintf(wxT("*** %s: %lu%%\n"), langDBINF_CACHE_HIT_RATIO, hitRatio); s += t; // Tablespace information - s += "\n"; + s += wxT("\n"); s += langDBINF_TABLESPACE_IO; - s += "\n"; + s += wxT("\n"); ULONG physWrites; char tablespaceName[257]; - pDb->ExecSql("SELECT NAME,PHYRDS,PHYWRTS FROM V$DATAFILE, V$FILESTAT WHERE V$DATAFILE.FILE# = V$FILESTAT.FILE#"); + pDb->ExecSql(wxT("SELECT NAME,PHYRDS,PHYWRTS FROM V$DATAFILE, V$FILESTAT WHERE V$DATAFILE.FILE# = V$FILESTAT.FILE#")); while (pDb->GetNext()) { pDb->GetData(1, SQL_C_CHAR, tablespaceName, 257, &cb); pDb->GetData(2, SQL_C_ULONG, &physReads, 0, &cb); pDb->GetData(3, SQL_C_ULONG, &physWrites, 0, &cb); - t.sprintf("%s\n\t%s: %lu\t%s: %lu\n", tablespaceName, + t.sprintf(wxT("%s\n\t%s: %lu\t%s: %lu\n"), tablespaceName, langDBINF_PHYSICAL_READS, physReads, langDBINF_PHYSICAL_WRITES, physWrites); s += t; } - s += "\n"; + s += wxT("\n"); } wxLogMessage(s); @@ -3146,7 +3146,7 @@ bool DbGridFrame::Initialize() wxGrid *grid = new wxGrid(this, -1, wxDefaultPosition); grid->RegisterDataType(wxGRID_VALUE_DATETIME, - new wxGridCellDateTimeRenderer(_T("%d %b %Y")), + new wxGridCellDateTimeRenderer(wxT("%d %b %Y")), new wxGridCellTextEditor); #ifdef CHOICEINT grid->RegisterDataType(wxGRID_VALUE_CHOICEINT, @@ -3196,7 +3196,7 @@ bool DbGridFrame::Initialize() { wxString tStr; tStr.Printf(wxT("Unable to open the table '%s'.\n\n"),CONTACT_TABLE_NAME); - wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__FILE__,__LINE__), + wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__TFILE__,__LINE__), wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION); } @@ -3211,7 +3211,7 @@ bool DbGridFrame::Initialize() { wxString tStr; tStr = wxT("ODBC error during Query()\n\n"); - wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__FILE__,__LINE__), + wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__TFILE__,__LINE__), wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION); return FALSE; } diff --git a/samples/db/dbtest.h b/samples/db/dbtest.h index eb5b691081..4f8e032e5e 100644 --- a/samples/db/dbtest.h +++ b/samples/db/dbtest.h @@ -19,7 +19,7 @@ enum DialogModes {mView,mCreate,mEdit,mSearch}; // ID for the menu quit command -#define FILE_CREATE 100 +#define FILE_CREATE_ID 100 #define FILE_RECREATE_TABLE 110 #define FILE_RECREATE_INDEXES 120 #if wxUSE_NEW_GRID @@ -39,7 +39,7 @@ enum DialogModes {mView,mCreate,mEdit,mSearch}; #endif // Name of the table to be created/opened -const wxChar CONTACT_TABLE_NAME[] = "contacts"; +const wxChar CONTACT_TABLE_NAME[] = wxT("contacts"); #define wxODBC_BLOB_EXPERIMENT 1 @@ -51,7 +51,7 @@ const int CONTACT_NO_COLS = 13; // 0-12 const int CONTACT_NO_COLS = 12; // 0-11 #endif -const wxChar PARAM_FILENAME[] = "dbtest.cfg"; +const wxChar PARAM_FILENAME[] = wxT("dbtest.cfg"); enum Language {langENGLISH, langFRENCH, langGERMAN, langSPANISH, langOTHER}; @@ -460,15 +460,15 @@ enum qryOp // Query strings -wxChar * const langQRY_EQ = "column = column | value"; -wxChar * const langQRY_LT = "column < column | value"; -wxChar * const langQRY_GT = "column > column | value"; -wxChar * const langQRY_LE = "column <= column | value"; -wxChar * const langQRY_GE = "column >= column | value"; -wxChar * const langQRY_BEGINS = "columns that BEGIN with the string entered"; -wxChar * const langQRY_CONTAINS = "columns that CONTAIN the string entered"; -wxChar * const langQRY_LIKE = "% matches 0 or more of any char; _ matches 1 char"; -wxChar * const langQRY_BETWEEN = "column BETWEEN value AND value"; +wxChar * const langQRY_EQ = wxT("column = column | value"); +wxChar * const langQRY_LT = wxT("column < column | value"); +wxChar * const langQRY_GT = wxT("column > column | value"); +wxChar * const langQRY_LE = wxT("column <= column | value"); +wxChar * const langQRY_GE = wxT("column >= column | value"); +wxChar * const langQRY_BEGINS = wxT("columns that BEGIN with the string entered"); +wxChar * const langQRY_CONTAINS = wxT("columns that CONTAIN the string entered"); +wxChar * const langQRY_LIKE = wxT("% matches 0 or more of any char; _ matches 1 char"); +wxChar * const langQRY_BETWEEN = wxT("column BETWEEN value AND value"); class CqueryDlg : public wxDialog @@ -560,95 +560,95 @@ DECLARE_EVENT_TABLE() #define QUERY_DIALOG_HINT_GROUP 323 #define QUERY_DIALOG_HINT_MSG 324 -char * const langNO = "No"; -char * const langYES = "Yes"; -char * const langDBINF_DB_NAME = "Database Name = "; -char * const langDBINF_DB_VER = "Database Version = "; -char * const langDBINF_DRIVER_NAME = "Driver Name = "; -char * const langDBINF_DRIVER_ODBC_VER = "Driver ODBC Version = "; -char * const langDBINF_DRIVER_MGR_ODBC_VER = "Driver Manager ODBC Version = "; -char * const langDBINF_DRIVER_VER = "Driver Version = "; -char * const langDBINF_SERVER_NAME = "Server Name = "; -char * const langDBINF_FILENAME = "Filename = "; -char * const langDBINF_OUTER_JOINS = "Outer Joins = "; -char * const langDBINF_STORED_PROC = "Stored Procedures = "; -char * const langDBINF_MAX_HDBC = "Max # of Db connections = "; -char * const langDBINF_MAX_HSTMT = "Max # of cursors (per db connection) = "; -char * const langDBINF_UNLIMITED = "Unlimited or Unknown"; -char * const langDBINF_API_LVL = "ODBC API conformance level = "; -char * const langDBINF_CLI_LVL = "Client (SAG) conformance level = "; -char * const langDBINF_SQL_LVL = "SQL conformance level = "; -char * const langDBINF_COMMIT_BEHAVIOR = "Commit Behavior = "; -char * const langDBINF_ROLLBACK_BEHAVIOR = "Rollback Behavior = "; -char * const langDBINF_SUPP_NOT_NULL = "Support NOT NULL clause = "; -char * const langDBINF_SUPP_IEF = "Support IEF = "; -char * const langDBINF_TXN_ISOLATION = "Transaction Isolation Level (default) = "; -char * const langDBINF_TXN_ISOLATION_CURR = "Transaction Isolation Level (current) = "; -char * const langDBINF_TXN_ISOLATION_OPTS = "Transaction Isolation Options Available = "; -char * const langDBINF_FETCH_DIRS = "Fetch Directions = "; -char * const langDBINF_LOCK_TYPES = "Lock Types (SQLSetPos) = "; -char * const langDBINF_POS_OPERS = "Position Operations (SQLSetPos) = "; -char * const langDBINF_POS_STMTS = "Position Statements = "; -char * const langDBINF_SCROLL_CONCURR = "Concurrency Options (scrollable cursors) = "; -char * const langDBINF_SCROLL_OPTS = "Scroll Options (scrollable cursors) = "; -char * const langDBINF_STATIC_SENS = "Static Sensitivity = "; -char * const langDBINF_TXN_CAPABLE = "Transaction Support = "; -char * const langDBINF_LOGIN_TIMEOUT = "Login Timeout = "; -char * const langDBINF_NONE = "None"; -char * const langDBINF_LEVEL1 = "Level 1"; -char * const langDBINF_LEVEL2 = "Level 2"; -char * const langDBINF_NOT_COMPLIANT = "Not Compliant"; -char * const langDBINF_COMPLIANT = "Compliant"; -char * const langDBINF_MIN_GRAMMAR = "Minimum Grammer"; -char * const langDBINF_CORE_GRAMMAR = "Core Grammer"; -char * const langDBINF_EXT_GRAMMAR = "Extended Grammer"; -char * const langDBINF_DELETE_CURSORS = "Delete cursors"; -char * const langDBINF_CLOSE_CURSORS = "Close cursors"; -char * const langDBINF_PRESERVE_CURSORS = "Preserve cursors"; -char * const langDBINF_READ_UNCOMMITTED = "Read Uncommitted"; -char * const langDBINF_READ_COMMITTED = "Read Committed"; -char * const langDBINF_REPEATABLE_READ = "Repeatable Read"; -char * const langDBINF_SERIALIZABLE = "Serializable"; -char * const langDBINF_VERSIONING = "Versioning"; -char * const langDBINF_NEXT = "Next"; -char * const langDBINF_PREV = "Prev"; -char * const langDBINF_FIRST = "First"; -char * const langDBINF_LAST = "Last"; -char * const langDBINF_ABSOLUTE = "Absolute"; -char * const langDBINF_RELATIVE = "Relative"; -char * const langDBINF_RESUME = "Resume"; -char * const langDBINF_BOOKMARK = "Bookmark"; -char * const langDBINF_NO_CHANGE = "No Change"; -char * const langDBINF_EXCLUSIVE = "Exclusive"; -char * const langDBINF_UNLOCK = "Unlock"; -char * const langDBINF_POSITION = "Position"; -char * const langDBINF_REFRESH = "Refresh"; -char * const langDBINF_UPD = "Upd"; -char * const langDBINF_DEL = "Del"; -char * const langDBINF_ADD = "Add"; -char * const langDBINF_POS_DEL = "Pos Delete"; -char * const langDBINF_POS_UPD = "Pos Update"; -char * const langDBINF_SELECT_FOR_UPD = "Select For Update"; -char * const langDBINF_READ_ONLY = "Read Only"; -char * const langDBINF_LOCK = "Lock"; -char * const langDBINF_OPT_ROWVER = "Opt. Rowver"; -char * const langDBINF_OPT_VALUES = "Opt. Values"; -char * const langDBINF_FWD_ONLY = "Fwd Only"; -char * const langDBINF_STATIC = "Static"; -char * const langDBINF_KEYSET_DRIVEN = "Keyset Driven"; -char * const langDBINF_DYNAMIC = "Dynamic"; -char * const langDBINF_MIXED = "Mixed"; -char * const langDBINF_ADDITIONS = "Additions"; -char * const langDBINF_DELETIONS = "Deletions"; -char * const langDBINF_UPDATES = "Updates"; -char * const langDBINF_DML_ONLY = "DML Only"; -char * const langDBINF_DDL_COMMIT = "DDL Commit"; -char * const langDBINF_DDL_IGNORE = "DDL Ignore"; -char * const langDBINF_DDL_AND_DML = "DDL and DML"; -char * const langDBINF_ORACLE_BANNER = ">>> ORACLE STATISTICS AND TUNING INFORMATION <<<"; -char * const langDBINF_DB_BLOCK_GETS = "DB block gets"; -char * const langDBINF_CONSISTENT_GETS = "Consistent gets"; -char * const langDBINF_PHYSICAL_READS = "Physical reads"; -char * const langDBINF_CACHE_HIT_RATIO = "Cache hit ratio"; -char * const langDBINF_TABLESPACE_IO = "TABLESPACE I/O LEVELS"; -char * const langDBINF_PHYSICAL_WRITES = "Physical writes"; +wxChar * const langNO = wxT("No"); +wxChar * const langYES = wxT("Yes"); +wxChar * const langDBINF_DB_NAME = wxT("Database Name = "); +wxChar * const langDBINF_DB_VER = wxT("Database Version = "); +wxChar * const langDBINF_DRIVER_NAME = wxT("Driver Name = "); +wxChar * const langDBINF_DRIVER_ODBC_VER = wxT("Driver ODBC Version = "); +wxChar * const langDBINF_DRIVER_MGR_ODBC_VER = wxT("Driver Manager ODBC Version = "); +wxChar * const langDBINF_DRIVER_VER = wxT("Driver Version = "); +wxChar * const langDBINF_SERVER_NAME = wxT("Server Name = "); +wxChar * const langDBINF_FILENAME = wxT("Filename = "); +wxChar * const langDBINF_OUTER_JOINS = wxT("Outer Joins = "); +wxChar * const langDBINF_STORED_PROC = wxT("Stored Procedures = "); +wxChar * const langDBINF_MAX_HDBC = wxT("Max # of Db connections = "); +wxChar * const langDBINF_MAX_HSTMT = wxT("Max # of cursors (per db connection) = "); +wxChar * const langDBINF_UNLIMITED = wxT("Unlimited or Unknown"); +wxChar * const langDBINF_API_LVL = wxT("ODBC API conformance level = "); +wxChar * const langDBINF_CLI_LVL = wxT("Client (SAG) conformance level = "); +wxChar * const langDBINF_SQL_LVL = wxT("SQL conformance level = "); +wxChar * const langDBINF_COMMIT_BEHAVIOR = wxT("Commit Behavior = "); +wxChar * const langDBINF_ROLLBACK_BEHAVIOR = wxT("Rollback Behavior = "); +wxChar * const langDBINF_SUPP_NOT_NULL = wxT("Support NOT NULL clause = "); +wxChar * const langDBINF_SUPP_IEF = wxT("Support IEF = "); +wxChar * const langDBINF_TXN_ISOLATION = wxT("Transaction Isolation Level (default) = "); +wxChar * const langDBINF_TXN_ISOLATION_CURR = wxT("Transaction Isolation Level (current) = "); +wxChar * const langDBINF_TXN_ISOLATION_OPTS = wxT("Transaction Isolation Options Available = "); +wxChar * const langDBINF_FETCH_DIRS = wxT("Fetch Directions = "); +wxChar * const langDBINF_LOCK_TYPES = wxT("Lock Types (SQLSetPos) = "); +wxChar * const langDBINF_POS_OPERS = wxT("Position Operations (SQLSetPos) = "); +wxChar * const langDBINF_POS_STMTS = wxT("Position Statements = "); +wxChar * const langDBINF_SCROLL_CONCURR = wxT("Concurrency Options (scrollable cursors) = "); +wxChar * const langDBINF_SCROLL_OPTS = wxT("Scroll Options (scrollable cursors) = "); +wxChar * const langDBINF_STATIC_SENS = wxT("Static Sensitivity = "); +wxChar * const langDBINF_TXN_CAPABLE = wxT("Transaction Support = "); +wxChar * const langDBINF_LOGIN_TIMEOUT = wxT("Login Timeout = "); +wxChar * const langDBINF_NONE = wxT("None"); +wxChar * const langDBINF_LEVEL1 = wxT("Level 1"); +wxChar * const langDBINF_LEVEL2 = wxT("Level 2"); +wxChar * const langDBINF_NOT_COMPLIANT = wxT("Not Compliant"); +wxChar * const langDBINF_COMPLIANT = wxT("Compliant"); +wxChar * const langDBINF_MIN_GRAMMAR = wxT("Minimum Grammer"); +wxChar * const langDBINF_CORE_GRAMMAR = wxT("Core Grammer"); +wxChar * const langDBINF_EXT_GRAMMAR = wxT("Extended Grammer"); +wxChar * const langDBINF_DELETE_CURSORS = wxT("Delete cursors"); +wxChar * const langDBINF_CLOSE_CURSORS = wxT("Close cursors"); +wxChar * const langDBINF_PRESERVE_CURSORS = wxT("Preserve cursors"); +wxChar * const langDBINF_READ_UNCOMMITTED = wxT("Read Uncommitted"); +wxChar * const langDBINF_READ_COMMITTED = wxT("Read Committed"); +wxChar * const langDBINF_REPEATABLE_READ = wxT("Repeatable Read"); +wxChar * const langDBINF_SERIALIZABLE = wxT("Serializable"); +wxChar * const langDBINF_VERSIONING = wxT("Versioning"); +wxChar * const langDBINF_NEXT = wxT("Next"); +wxChar * const langDBINF_PREV = wxT("Prev"); +wxChar * const langDBINF_FIRST = wxT("First"); +wxChar * const langDBINF_LAST = wxT("Last"); +wxChar * const langDBINF_ABSOLUTE = wxT("Absolute"); +wxChar * const langDBINF_RELATIVE = wxT("Relative"); +wxChar * const langDBINF_RESUME = wxT("Resume"); +wxChar * const langDBINF_BOOKMARK = wxT("Bookmark"); +wxChar * const langDBINF_NO_CHANGE = wxT("No Change"); +wxChar * const langDBINF_EXCLUSIVE = wxT("Exclusive"); +wxChar * const langDBINF_UNLOCK = wxT("Unlock"); +wxChar * const langDBINF_POSITION = wxT("Position"); +wxChar * const langDBINF_REFRESH = wxT("Refresh"); +wxChar * const langDBINF_UPD = wxT("Upd"); +wxChar * const langDBINF_DEL = wxT("Del"); +wxChar * const langDBINF_ADD = wxT("Add"); +wxChar * const langDBINF_POS_DEL = wxT("Pos Delete"); +wxChar * const langDBINF_POS_UPD = wxT("Pos Update"); +wxChar * const langDBINF_SELECT_FOR_UPD = wxT("Select For Update"); +wxChar * const langDBINF_READ_ONLY = wxT("Read Only"); +wxChar * const langDBINF_LOCK = wxT("Lock"); +wxChar * const langDBINF_OPT_ROWVER = wxT("Opt. Rowver"); +wxChar * const langDBINF_OPT_VALUES = wxT("Opt. Values"); +wxChar * const langDBINF_FWD_ONLY = wxT("Fwd Only"); +wxChar * const langDBINF_STATIC = wxT("Static"); +wxChar * const langDBINF_KEYSET_DRIVEN = wxT("Keyset Driven"); +wxChar * const langDBINF_DYNAMIC = wxT("Dynamic"); +wxChar * const langDBINF_MIXED = wxT("Mixed"); +wxChar * const langDBINF_ADDITIONS = wxT("Additions"); +wxChar * const langDBINF_DELETIONS = wxT("Deletions"); +wxChar * const langDBINF_UPDATES = wxT("Updates"); +wxChar * const langDBINF_DML_ONLY = wxT("DML Only"); +wxChar * const langDBINF_DDL_COMMIT = wxT("DDL Commit"); +wxChar * const langDBINF_DDL_IGNORE = wxT("DDL Ignore"); +wxChar * const langDBINF_DDL_AND_DML = wxT("DDL and DML"); +wxChar * const langDBINF_ORACLE_BANNER = wxT(">>> ORACLE STATISTICS AND TUNING INFORMATION <<<"); +wxChar * const langDBINF_DB_BLOCK_GETS = wxT("DB block gets"); +wxChar * const langDBINF_CONSISTENT_GETS = wxT("Consistent gets"); +wxChar * const langDBINF_PHYSICAL_READS = wxT("Physical reads"); +wxChar * const langDBINF_CACHE_HIT_RATIO = wxT("Cache hit ratio"); +wxChar * const langDBINF_TABLESPACE_IO = wxT("TABLESPACE I/O LEVELS"); +wxChar * const langDBINF_PHYSICAL_WRITES = wxT("Physical writes"); diff --git a/samples/db/listdb.cpp b/samples/db/listdb.cpp index a38a43caa0..89a795c70a 100644 --- a/samples/db/listdb.cpp +++ b/samples/db/listdb.cpp @@ -89,7 +89,7 @@ extern wxApp *DatabaseDemoApp; * NOTE: The value returned by this function is for temporary use only and * should be copied for long term use */ -const char *GetExtendedDBErrorMsg2(wxDb *pDb, char *ErrFile, int ErrLine) +const wxChar *GetExtendedDBErrorMsg2(wxDb *pDb, wxChar *ErrFile, int ErrLine) { static wxString msg; msg = wxT(""); @@ -307,7 +307,7 @@ ClookUpDlg::ClookUpDlg(wxWindow *parent, wxChar *windowTitle, wxChar *tableName, { wxString tStr; tStr.Printf(wxT("Unable to open the table '%s'."),tableName); - tStr += GetExtendedDBErrorMsg2(pDb,__FILE__,__LINE__); + tStr += GetExtendedDBErrorMsg2(pDb,__TFILE__,__LINE__); wxMessageBox(tStr,wxT("ODBC Error...")); Close(); return; @@ -339,7 +339,7 @@ ClookUpDlg::ClookUpDlg(wxWindow *parent, wxChar *windowTitle, wxChar *tableName, return; } if (lookup2->GetNext()) - maxColLen = col1Len = atoi(lookup2->lookupCol1); + maxColLen = col1Len = wxAtoi(lookup2->lookupCol1); else wxMessageBox(wxT("ODBC error during GetNext()"),wxT("ODBC Error...")); } @@ -430,7 +430,7 @@ void ClookUpDlg::OnButton( wxCommandEvent &event ) } -void ClookUpDlg::OnCommand(wxWindow& win, wxCommandEvent& event) +void ClookUpDlg::OnCommand(wxWindow& win, wxCommandEvent& WXUNUSED(event)) { wxString widgetName = win.GetName(); diff --git a/samples/db/listdb.h b/samples/db/listdb.h index dbd943b365..866ea8a5df 100644 --- a/samples/db/listdb.h +++ b/samples/db/listdb.h @@ -32,7 +32,7 @@ class Clookup : public wxDbTable wxChar lookupCol[LOOKUP_COL_LEN+1]; - Clookup(wxChar *tblName, wxChar *colName, wxDb *pDb, const wxString &defDir=""); + Clookup(wxChar *tblName, wxChar *colName, wxDb *pDb, const wxString &defDir=wxT("")); }; // Clookup @@ -45,7 +45,7 @@ class Clookup2 : public wxDbTable wxChar lookupCol1[LOOKUP_COL_LEN+1]; wxChar lookupCol2[LOOKUP_COL_LEN+1]; - Clookup2(wxChar *tblName, wxChar *colName1, wxChar *colName2, wxDb *pDb, const wxString &defDir=""); + Clookup2(wxChar *tblName, wxChar *colName1, wxChar *colName2, wxDb *pDb, const wxString &defDir=wxT("")); }; // Clookup2