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
c++csshelp
2 Posts 2 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 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' }

    C 1 Reply Last reply
    0
    • D durban2

      MFC, STUDIO 2008, MDI-project 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' }

      C Offline
      C Offline
      CPallini
      wrote on last edited by
      #2

      Have you considered including the header wherein CAdderDialog is declared? :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
      [My articles]

      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