Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. pointer on class

pointer on class

Scheduled Pinned Locked Moved C / C++ / MFC
7 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    durban2
    wrote on last edited by
    #1

    MFC, STUDIO 2008, MDI-project If to comment СAdderDialog* m_pModeless5; then OK! // modeldlg.h : implementation file protected: СAdderDialog* m_pModeless5; // pointer on class error C2143: syntax error : missing ';' before '*' error C4430: missing type specifier - int assumed. Note: C++ does not support default-int error C4430: missing type specifier - int assumed. Note: C++ does not support default-int : error C2614: 'CMainDlg' : illegal member initialization: 'm_pModeless5' is not a base or member class CAdderDialog : public Cdialog class CMainDlg : public Cdialog // adderdlg.cpp : implementation file #include "stdafx.h" #include "ADO_MDI.h" #include "Aadderdlg.h" #include "modeldlg.h" // modeldlg.cpp : implementation file #include "stdafx.h" #include "ADO_MDI.h" #include "Aadderdlg.h" #include "modeldlg.h"

    _ P K T 4 Replies Last reply
    0
    • D durban2

      MFC, STUDIO 2008, MDI-project If to comment СAdderDialog* m_pModeless5; then OK! // modeldlg.h : implementation file protected: СAdderDialog* m_pModeless5; // pointer on class error C2143: syntax error : missing ';' before '*' error C4430: missing type specifier - int assumed. Note: C++ does not support default-int error C4430: missing type specifier - int assumed. Note: C++ does not support default-int : error C2614: 'CMainDlg' : illegal member initialization: 'm_pModeless5' is not a base or member class CAdderDialog : public Cdialog class CMainDlg : public Cdialog // adderdlg.cpp : implementation file #include "stdafx.h" #include "ADO_MDI.h" #include "Aadderdlg.h" #include "modeldlg.h" // modeldlg.cpp : implementation file #include "stdafx.h" #include "ADO_MDI.h" #include "Aadderdlg.h" #include "modeldlg.h"

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      CHIVOTIOV wrote:

      #include "Aadderdlg.h"

      Any typo there?

      «_Superman_» I love work. It gives me something to do between weekends.

      1 Reply Last reply
      0
      • D durban2

        MFC, STUDIO 2008, MDI-project If to comment СAdderDialog* m_pModeless5; then OK! // modeldlg.h : implementation file protected: СAdderDialog* m_pModeless5; // pointer on class error C2143: syntax error : missing ';' before '*' error C4430: missing type specifier - int assumed. Note: C++ does not support default-int error C4430: missing type specifier - int assumed. Note: C++ does not support default-int : error C2614: 'CMainDlg' : illegal member initialization: 'm_pModeless5' is not a base or member class CAdderDialog : public Cdialog class CMainDlg : public Cdialog // adderdlg.cpp : implementation file #include "stdafx.h" #include "ADO_MDI.h" #include "Aadderdlg.h" #include "modeldlg.h" // modeldlg.cpp : implementation file #include "stdafx.h" #include "ADO_MDI.h" #include "Aadderdlg.h" #include "modeldlg.h"

        P Offline
        P Offline
        Paresh Chitte
        wrote on last edited by
        #3

        Forward declare class СAdderDialog before class declaration; class СAdderDialog; Regards, Paresh.

        1 Reply Last reply
        0
        • D durban2

          MFC, STUDIO 2008, MDI-project If to comment СAdderDialog* m_pModeless5; then OK! // modeldlg.h : implementation file protected: СAdderDialog* m_pModeless5; // pointer on class error C2143: syntax error : missing ';' before '*' error C4430: missing type specifier - int assumed. Note: C++ does not support default-int error C4430: missing type specifier - int assumed. Note: C++ does not support default-int : error C2614: 'CMainDlg' : illegal member initialization: 'm_pModeless5' is not a base or member class CAdderDialog : public Cdialog class CMainDlg : public Cdialog // adderdlg.cpp : implementation file #include "stdafx.h" #include "ADO_MDI.h" #include "Aadderdlg.h" #include "modeldlg.h" // modeldlg.cpp : implementation file #include "stdafx.h" #include "ADO_MDI.h" #include "Aadderdlg.h" #include "modeldlg.h"

          K Offline
          K Offline
          KarstenK
          wrote on last edited by
          #4

          Typo: #include "Aadderdlg.h" //"a" too much X| for class #include СAdderDialog

          Press F1 for help or google it. Greetings from Germany

          D 1 Reply Last reply
          0
          • D durban2

            MFC, STUDIO 2008, MDI-project If to comment СAdderDialog* m_pModeless5; then OK! // modeldlg.h : implementation file protected: СAdderDialog* m_pModeless5; // pointer on class error C2143: syntax error : missing ';' before '*' error C4430: missing type specifier - int assumed. Note: C++ does not support default-int error C4430: missing type specifier - int assumed. Note: C++ does not support default-int : error C2614: 'CMainDlg' : illegal member initialization: 'm_pModeless5' is not a base or member class CAdderDialog : public Cdialog class CMainDlg : public Cdialog // adderdlg.cpp : implementation file #include "stdafx.h" #include "ADO_MDI.h" #include "Aadderdlg.h" #include "modeldlg.h" // modeldlg.cpp : implementation file #include "stdafx.h" #include "ADO_MDI.h" #include "Aadderdlg.h" #include "modeldlg.h"

            T Offline
            T Offline
            ThatsAlok
            wrote on last edited by
            #5

            classic case of non-usuage of forward decalaration

            "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
            Never mind - my own stupidity is the source of every "problem" - Mixture

            cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

            1 Reply Last reply
            0
            • K KarstenK

              Typo: #include "Aadderdlg.h" //"a" too much X| for class #include СAdderDialog

              Press F1 for help or google it. Greetings from Germany

              D Offline
              D Offline
              durban2
              wrote on last edited by
              #6

              advanced to forward, 2 errors became less: #pragma once class СAdderDialog; // after addition this line into file "modeldlg.h" eliminate (remove)only 2 errors // CMainDlg class CMainDlg : public CDialog { СAdderDialog* m_pModeless5; CMainDlg::CMainDlg(CWnd* pParent /*=NULL*/) : CDialog(CMainDlg::IDD, pParent) , m_pModeless5(NULL) { . . . . . . . . . . . /////////////////////////////////////// void CMainDlg::OnOK() { if (m_pModeless5 == NULL) // OK! { m_pModeless5 = new CAdderDialog(this); // error C2440: '=' : cannot convert from 'CAdderDialog *' to 'СAdderDialog *' if (m_pModeless5->Create() == TRUE) // modeldlg.cpp(67) : error C2027: use of undefined type 'СAdderDialog' // error C2227: left of '->Create' must point to class/struct/union/generic type GetDlgItem(IDOK)->EnableWindow(FALSE); } else m_pModeless5->SetActiveWindow(); // error C2027: use of undefined type 'СAdderDialog' }

              K 1 Reply Last reply
              0
              • D durban2

                advanced to forward, 2 errors became less: #pragma once class СAdderDialog; // after addition this line into file "modeldlg.h" eliminate (remove)only 2 errors // CMainDlg class CMainDlg : public CDialog { СAdderDialog* m_pModeless5; CMainDlg::CMainDlg(CWnd* pParent /*=NULL*/) : CDialog(CMainDlg::IDD, pParent) , m_pModeless5(NULL) { . . . . . . . . . . . /////////////////////////////////////// void CMainDlg::OnOK() { if (m_pModeless5 == NULL) // OK! { m_pModeless5 = new CAdderDialog(this); // error C2440: '=' : cannot convert from 'CAdderDialog *' to 'СAdderDialog *' if (m_pModeless5->Create() == TRUE) // modeldlg.cpp(67) : error C2027: use of undefined type 'СAdderDialog' // error C2227: left of '->Create' must point to class/struct/union/generic type GetDlgItem(IDOK)->EnableWindow(FALSE); } else m_pModeless5->SetActiveWindow(); // error C2027: use of undefined type 'СAdderDialog' }

                K Offline
                K Offline
                KarstenK
                wrote on last edited by
                #7

                you got to include the CAdderDialog-Header file :zzz:

                Press F1 for help or google it. Greetings from Germany

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups