
VC1.52!!Whats wrong with this??
Hello there :)
Im writing a VC1.52 program and my dialog wont work.
Ive just created a dialog, which has edit controls mapped to the ODBC
database(Crecordset object), via foreign variables m_pSet.> ect. but my
dialog is not showing up at all.
So I thought I would try and catch the DBexception. but "try" is now
allowed in VC1.52 only "TRY" (does this make a difference?), and the
error when compiled is:
**** error C2143: syntax error : missing ';' before 'catch' ****
How should I initialize the dialog so it pops up with the assigned
recordset? What am I doing wrong? Without the 3 edit controls, just as
a dialog box, it works fine... so it must be the database elements.
My code:
void CCalendarApp::OnShiftShiftdata()
{
CShiftdlg shiftdlg;
shiftdlg.DoModal; // Create instance of dialog class
Quote:
}
BOOL CShiftdlg::OnInitDialog()
{
TRY {
CtblShift* m_pSet; // Create an instance of Recordset CtblShift
m_pSet->Open(); // Open Recordset
UpdateData(FALSE);
}
catch(CDBException *e) {
AfxMessageBox(CString("Cannot Open Database.\n")
+ e->m_strError, MB_ICONSTOP);
throw;
)
CDialog::OnInitDialog();
return TRUE; // return TRUE unless you set the focus to a control
Quote:
}