wxChar* usage changed over to wxString in various places

Warning fixes when compiling in compatibility 2_4 mode to force use of the desired wxDbTable constructor


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30410 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
George Tasker
2004-11-10 12:12:37 +00:00
parent 4e8f1c6dba
commit c3677ad324
2 changed files with 25 additions and 25 deletions

View File

@@ -1015,7 +1015,7 @@ void DatabaseDemoFrame::BuildParameterDialog(wxWindow *parent)
* will be committed or rolled back when any of the objects has this function call made. * will be committed or rolled back when any of the objects has this function call made.
*/ */
Ccontact::Ccontact (wxDb *pwxDb) : wxDbTable(pwxDb ? pwxDb : wxDbGetConnection(wxGetApp().DbConnectInf), Ccontact::Ccontact (wxDb *pwxDb) : wxDbTable(pwxDb ? pwxDb : wxDbGetConnection(wxGetApp().DbConnectInf),
CONTACT_TABLE_NAME, CONTACT_NO_COLS, wxEmptyString, CONTACT_TABLE_NAME, CONTACT_NO_COLS, (const wxString &)wxEmptyString,
!wxDB_QUERY_ONLY, wxGetApp().DbConnectInf->GetDefaultDir()) !wxDB_QUERY_ONLY, wxGetApp().DbConnectInf->GetDefaultDir())
{ {
// This is used to represent whether the database connection should be released // This is used to represent whether the database connection should be released
@@ -1359,7 +1359,7 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& WXUNUSED(event))
// Display the query dialog box // Display the query dialog box
wxChar qryWhere[DB_MAX_WHERE_CLAUSE_LEN+1]; wxChar qryWhere[DB_MAX_WHERE_CLAUSE_LEN+1];
wxStrcpy(qryWhere, (const wxChar*) wxGetApp().Contact->qryWhereStr); wxStrcpy(qryWhere, (const wxChar*) wxGetApp().Contact->qryWhereStr);
wxChar *tblName[] = {(wxChar *)CONTACT_TABLE_NAME, 0}; wxChar *tblName[] = {(wxChar *)CONTACT_TABLE_NAME.c_str(), 0};
new CqueryDlg(GetParent(), wxGetApp().Contact->GetDb(), tblName, qryWhere); new CqueryDlg(GetParent(), wxGetApp().Contact->GetDb(), tblName, qryWhere);
// Query the first record in the new record set and // Query the first record in the new record set and
@@ -1444,12 +1444,12 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& WXUNUSED(event))
if (widgetName == pNameListBtn->GetName()) if (widgetName == pNameListBtn->GetName())
{ {
new ClookUpDlg(/* wxWindow *parent */ this, new ClookUpDlg(/* wxWindow *parent */ this,
/* wxChar *windowTitle */ wxT("Select contact name"), /* const wxString &windowTitle */ wxT("Select contact name"),
/* wxChar *tableName */ (wxChar *) CONTACT_TABLE_NAME, /* const wxString &tableName */ CONTACT_TABLE_NAME,
/* wxChar *dispCol1 */ wxT("NAME"), /* const wxString &dispCol1 */ wxT("NAME"),
/* wxChar *dispCol2 */ wxT("JOINDATE"), /* const wxString &dispCol2 */ wxT("JOINDATE"),
/* wxChar *where */ wxT(""), /* const wxString &where */ wxT(""),
/* wxChar *orderBy */ wxT("NAME"), /* const wxString &orderBy */ wxT("NAME"),
/* wxDb *pDb */ wxGetApp().READONLY_DB, /* wxDb *pDb */ wxGetApp().READONLY_DB,
/* const wxString &defDir */ wxGetApp().DbConnectInf->GetDefaultDir(), /* const wxString &defDir */ wxGetApp().DbConnectInf->GetDefaultDir(),
/* bool distinctValues*/ true); /* bool distinctValues*/ true);
@@ -1518,7 +1518,7 @@ bool CeditorDlg::Initialize()
// Check if the table exists or not. If it doesn't, ask the user if they want to // Check if the table exists or not. If it doesn't, ask the user if they want to
// create the table. Continue trying to create the table until it exists, or user aborts // create the table. Continue trying to create the table until it exists, or user aborts
while (!wxGetApp().Contact->GetDb()->TableExists((wxChar *)CONTACT_TABLE_NAME, while (!wxGetApp().Contact->GetDb()->TableExists(CONTACT_TABLE_NAME,
wxGetApp().DbConnectInf->GetUserID(), wxGetApp().DbConnectInf->GetUserID(),
wxGetApp().DbConnectInf->GetDefaultDir())) wxGetApp().DbConnectInf->GetDefaultDir()))
{ {
@@ -2818,7 +2818,7 @@ void CqueryDlg::ProcessCountBtn()
if (!dbTable) // wxDbTable object needs to be created and opened if (!dbTable) // wxDbTable object needs to be created and opened
{ {
dbTable = new wxDbTable(pDB, masterTableName, 0, wxEmptyString, dbTable = new wxDbTable(pDB, masterTableName, 0, (const wxString &)wxEmptyString,
!wxDB_QUERY_ONLY, !wxDB_QUERY_ONLY,
wxGetApp().DbConnectInf->GetDefaultDir()); wxGetApp().DbConnectInf->GetDefaultDir());
if (!dbTable) if (!dbTable)

View File

@@ -40,7 +40,7 @@ enum DialogModes {mView,mCreate,mEdit,mSearch};
#endif #endif
// Name of the table to be created/opened // Name of the table to be created/opened
const wxChar CONTACT_TABLE_NAME[] = wxT("contacts"); const wxString CONTACT_TABLE_NAME = wxT("contacts");
#define wxODBC_BLOB_SUPPORT #define wxODBC_BLOB_SUPPORT
@@ -53,7 +53,7 @@ const wxChar CONTACT_TABLE_NAME[] = wxT("contacts");
const int CONTACT_NO_COLS = 12; // 0-11 const int CONTACT_NO_COLS = 12; // 0-11
#endif #endif
const wxChar PARAM_FILENAME[] = wxT("dbtest.cfg"); const wxString PARAM_FILENAME = wxT("dbtest.cfg");
enum Language {langENGLISH, langFRENCH, langGERMAN, langSPANISH, langOTHER}; enum Language {langENGLISH, langFRENCH, langGERMAN, langSPANISH, langOTHER};
@@ -479,15 +479,15 @@ enum qryOp
// Query strings // Query strings
wxChar * const langQRY_EQ = wxT("column = column | value"); wxString const & langQRY_EQ = wxT("column = column | value");
wxChar * const langQRY_LT = wxT("column < column | value"); const wxString & langQRY_LT = wxT("column < column | value");
wxChar * const langQRY_GT = wxT("column > column | value"); const wxString & langQRY_GT = wxT("column > column | value");
wxChar * const langQRY_LE = wxT("column <= column | value"); const wxString & langQRY_LE = wxT("column <= column | value");
wxChar * const langQRY_GE = wxT("column >= column | value"); const wxString & langQRY_GE = wxT("column >= column | value");
wxChar * const langQRY_BEGINS = wxT("columns that BEGIN with the string entered"); const wxString & langQRY_BEGINS = wxT("columns that BEGIN with the string entered");
wxChar * const langQRY_CONTAINS = wxT("columns that CONTAIN the string entered"); const wxString & langQRY_CONTAINS = wxT("columns that CONTAIN the string entered");
wxChar * const langQRY_LIKE = wxT("% matches 0 or more of any char; _ matches 1 char"); const wxString & langQRY_LIKE = wxT("% matches 0 or more of any char; _ matches 1 char");
wxChar * const langQRY_BETWEEN = wxT("column BETWEEN value AND value"); const wxString & langQRY_BETWEEN = wxT("column BETWEEN value AND value");
class CqueryDlg : public wxDialog class CqueryDlg : public wxDialog