wxLogMessage(nativeDataTypeName);
}
#endif
+#ifdef SQL_WVARCHAR
+ if (DataTypeSupported(pDb,SQL_WVARCHAR, &nativeDataTypeName))
+ {
+ nativeDataTypeName = wxT("SQL_WVARCHAR (") + nativeDataTypeName;
+ nativeDataTypeName += wxT(")\n");
+ wxLogMessage(nativeDataTypeName);
+ }
+#endif
+#ifdef SQL_WCHAR
+ if (DataTypeSupported(pDb,SQL_WCHAR, &nativeDataTypeName))
+ {
+ nativeDataTypeName = wxT("SQL_WCHAR (") + nativeDataTypeName;
+ nativeDataTypeName += wxT(")\n");
+ wxLogMessage(nativeDataTypeName);
+ }
+#endif
wxLogMessage(wxT("Done\n"));
} // CheckSupportForAllDataTypes()
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);
+ 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.c_str());
wxMessageBox(tStr,wxT("File I/O Error..."),wxOK | wxICON_EXCLAMATION);
return false;
if ((paramFile = wxFopen(PARAM_FILENAME, wxT("wt"))) == NULL)
{
wxString tStr;
- tStr.Printf(wxT("Unable to write/overwrite '%s'."),PARAM_FILENAME);
+ tStr.Printf(wxT("Unable to write/overwrite '%s'."),PARAM_FILENAME.c_str());
wxMessageBox(tStr,wxT("File I/O Error..."),wxOK | wxICON_EXCLAMATION);
return false;
}
* 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),
- CONTACT_TABLE_NAME, CONTACT_NO_COLS, wxEmptyString,
+ CONTACT_TABLE_NAME, CONTACT_NO_COLS, (const wxString &)wxEmptyString,
!wxDB_QUERY_ONLY, wxGetApp().DbConnectInf->GetDefaultDir())
{
// This is used to represent whether the database connection should be released
if (!Ok)
return;
- if (saveName.IsEmpty())
+ if (saveName.empty())
{
wxGetApp().Contact->Initialize();
PutData();
// Display the query dialog box
wxChar qryWhere[DB_MAX_WHERE_CLAUSE_LEN+1];
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);
// Query the first record in the new record set and
}
// Enable/Disable the reset button
- pResetBtn->Enable(!wxGetApp().Contact->qryWhereStr.IsEmpty());
+ pResetBtn->Enable(!wxGetApp().Contact->qryWhereStr.empty());
return;
} // Query button
if (widgetName == pNameListBtn->GetName())
{
- new ClookUpDlg(/* wxWindow *parent */ this,
- /* wxChar *windowTitle */ wxT("Select contact name"),
- /* wxChar *tableName */ (wxChar *) CONTACT_TABLE_NAME,
- /* wxChar *dispCol1 */ wxT("NAME"),
- /* wxChar *dispCol2 */ wxT("JOINDATE"),
- /* wxChar *where */ wxT(""),
- /* wxChar *orderBy */ wxT("NAME"),
- /* wxDb *pDb */ wxGetApp().READONLY_DB,
- /* const wxString &defDir */ wxGetApp().DbConnectInf->GetDefaultDir(),
- /* bool distinctValues */ true);
+ new ClookUpDlg(/* wxWindow *parent */ this,
+ /* const wxString &windowTitle */ wxT("Select contact name"),
+ /* const wxString &tableName */ CONTACT_TABLE_NAME,
+ /* const wxString &dispCol1 */ wxT("NAME"),
+ /* const wxString &dispCol2 */ wxT("JOINDATE"),
+ /* const wxString &where */ wxT(""),
+ /* const wxString &orderBy */ wxT("NAME"),
+ /* wxDb *pDb */ wxGetApp().READONLY_DB,
+ /* const wxString &defDir */ wxGetApp().DbConnectInf->GetDefaultDir(),
+ /* bool distinctValues*/ true,
+ wxEmptyString, 20);
if (ListDB_Selection && wxStrlen(ListDB_Selection))
{
if (wxGetApp().Contact->GetDb()->Catalog(wxEmptyString, wxT("catalog.txt")))
wxMessageBox(wxT("The file 'catalog.txt' was created."));
else
- wxMessageBox(wxT("Creation of the file 'catalog.txt' was failed."));
+ wxMessageBox(wxT("Creation of the file 'catalog.txt' failed."));
return;
}
// 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
- while (!wxGetApp().Contact->GetDb()->TableExists((wxChar *)CONTACT_TABLE_NAME,
+ while (!wxGetApp().Contact->GetDb()->TableExists(CONTACT_TABLE_NAME,
wxGetApp().DbConnectInf->GetUserID(),
wxGetApp().DbConnectInf->GetDefaultDir()))
{
wxString tStr;
- tStr.Printf(wxT("Unable to open the table '%s'. The table may\nneed to be created.\n\nDo you wish to try to create/clear the table?\n\n"),CONTACT_TABLE_NAME);
+ tStr.Printf(wxT("Unable to open the table '%s'. The table may\nneed to be created.\n\nDo you wish to try to create/clear the table?\n\n"),CONTACT_TABLE_NAME.c_str());
bool createTable = (wxMessageBox(tStr.c_str(),wxT("Confirm"),wxYES_NO|wxICON_QUESTION) == wxYES);
if (!createTable)
wxGetApp().DbConnectInf->GetDefaultDir()))
{
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);
+ tStr.Printf(wxT("Unable to open the table '%s' (likely due to\ninsufficient privileges of the logged in user).\n\n"),CONTACT_TABLE_NAME.c_str());
wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__TFILE__,__LINE__),
wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION);
wxGetApp().DbConnectInf->GetDefaultDir()))
{
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);
+ 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.c_str());
wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__TFILE__,__LINE__),
wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION);
}
pPictSizeTxt = new wxTextCtrl(this, EDITOR_DIALOG_PIC_SIZE_TEXT, wxEmptyString, wxPoint(175,447), wxSize(120, 25), 0, wxDefaultValidator, wxT("PictSizeTxt"));
#endif
- // Now that all the widgets on the panel are created, its safe to allow ::OnCommand() to
+ // Now that all the widgets on the panel are created, its safe to allow ::OnCommand() to
// handle all widget processing
widgetPtrsSet = true;
if (file.IsOpened())
{
- off_t iSize = file.Length();
+ // assume not huge file in sample
+ long iSize = (long)file.Length();
if ((iSize > 0) && (iSize < MAX_PICTURE_SIZE))
{
- off_t iReadSize = 0;
-
- wxGetApp().Contact->BlobSize = iSize;
+ wxGetApp().Contact->BlobSize = (size_t)iSize;
memset(wxGetApp().Contact->Picture, 0, MAX_PICTURE_SIZE);
- iReadSize = file.Read(wxGetApp().Contact->Picture, iSize);
+ wxFileOffset iReadSize = file.Read(wxGetApp().Contact->Picture, (size_t)iSize);
if (iReadSize < iSize)
wxMessageBox(wxT("Something bad happened while reading..."), wxT("BLOB Loading Error"), wxOK | wxICON_EXCLAMATION);
wxString tStr;
- tStr.Printf(wxT("%lu"),iSize);
+ tStr.Printf(wxT("%ld"),iSize);
pPictSizeTxt->SetValue(tStr);
}
else
pPrevBtn->Enable( !edit );
pNextBtn->Enable( !edit );
pQueryBtn->Enable( !edit );
- pResetBtn->Enable( !edit && !wxGetApp().Contact->qryWhereStr.IsEmpty() );
+ pResetBtn->Enable( !edit && !wxGetApp().Contact->qryWhereStr.empty() );
pNameListBtn->Enable( !edit );
}
w += wxT("'");
// If a query where string is currently set, append that criteria
- if (!wxGetApp().Contact->qryWhereStr.IsEmpty())
+ if (!wxGetApp().Contact->qryWhereStr.empty())
{
w += wxT(" AND (");
w += wxGetApp().Contact->qryWhereStr;
w += wxT("'");
// If a query where string is currently set, append that criteria
- if (!wxGetApp().Contact->qryWhereStr.IsEmpty())
+ if (!wxGetApp().Contact->qryWhereStr.empty())
{
w += wxT(" AND (");
w += wxGetApp().Contact->qryWhereStr;
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,
wxGetApp().DbConnectInf->GetDefaultDir());
if (!dbTable)
CimageDlg::CimageDlg(wxWindow *parent, wxChar *pImageData, off_t iSize)
: wxDialog(parent, IMAGE_DIALOG, wxT("BLOB Image"), wxDefaultPosition, wxDefaultSize),
-m_pImage(NULL),
+m_pDisplayBmp(NULL),
m_pBmp(NULL),
-m_pDisplayBmp(NULL)
+m_pImage(NULL)
{
wxMemoryInputStream inStream(pImageData, iSize);
wxGetApp().DbConnectInf->GetDefaultDir()))
{
wxString tStr;
- tStr.Printf(wxT("Unable to open the table '%s'.\n\n"),CONTACT_TABLE_NAME);
+ tStr.Printf(wxT("Unable to open the table '%s'.\n\n"),CONTACT_TABLE_NAME.c_str());
wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__TFILE__,__LINE__),
wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION);
}