VC1.52!!Whats wrong with this?? 
Author Message
 VC1.52!!Whats wrong with this??

About exceptions: In VC1.52 this is implemented as macros in the form:

TRY
{
   // try this code

Quote:
}

CATCH(CException, e)
{
   // catch the exception
Quote:
}

END_CATCH

It's well documented in the help files.

  - Stein Roger

Quote:

> 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' ****



Wed, 15 Sep 1999 03:00:00 GMT  
 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:
}



Wed, 15 Sep 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. HELP! Whats wrong with this code?VC1.52

2. Help - How to access MS-ACCess from VC1.52

3. Problem with vc1.52, dos window in win95 and graphics program

4. ldllcew.lib - converting VC1.52 to VC5

5. Help porting VC1.52 DLL to VC2.2 DLL

6. VC1.52 and Win95

7. VC1.52 Setup Install Program

8. Tabbing using VC1.52

9. VC1.52 Compiler optimisation problem

10. OCX Control in a VC1.52??

11. Using API function with VC1.52

12. (Urgent, plz help)Problem getting app pointer in VC1.52 (16bit)

 

 
Powered by phpBB® Forum Software