Ask a questionAsk a question
 

Answercreated class does not compile

  • Tuesday, November 03, 2009 5:50 PMDalai Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code
    using Visual Studio 2008. as of today, some reason if I create a new MFC Dialog based C++ project, add an MFC class CTmp to it and then reference this is the Dlg.cpp ...

    // Ctest4Dlg dialog
    class Ctest4Dlg : public CDialog
    {
    // Construction
    public:
    Ctest4Dlg(CWnd* pParent = NULL); // standard constructor

    // Dialog Data
    enum { IDD = IDD_TEST4_DIALOG };

    protected:
    virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support

    CTmp ct; //<<<<------- here

    // Implementation
    protected:
    HICON m_hIcon;

    // Generated message map functions
    virtual BOOL OnInitDialog();
    afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
    afx_msg void OnPaint();
    afx_msg HCURSOR OnQueryDragIcon();
    DECLARE_MESSAGE_MAP()
    };

    and try and compile, I get:

    Error    1    error C2146: syntax error : missing ';' before identifier 'ct'

    anyone any ideas?

Answers

All Replies