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. Show New Window

Show New Window

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 Posts 3 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.
  • Z Offline
    Z Offline
    zeki yugnak
    wrote on last edited by
    #1

    hii.. I created the window,like this: class CNewWnd : public CWnd { public: CNewWnd(void); ~CNewWnd(void); }; CNewWnd::CNewWnd(void) { this->Create("CNewWnd","New Window",WS_CHILD|WS_OVERLAPPEDWINDOW|WS_VISIBLE,CRect(10,10,200,200),this->GetParent(),NULL); } And I want to show this window when pressed the button.I have wanted to do this,like this but this didnt worked:confused:. CNewWnd m_NewWnd; m_NewWnd.ShowWindow(SW_NORMAL); I am novice.how can I do this?

    B R 2 Replies Last reply
    0
    • Z zeki yugnak

      hii.. I created the window,like this: class CNewWnd : public CWnd { public: CNewWnd(void); ~CNewWnd(void); }; CNewWnd::CNewWnd(void) { this->Create("CNewWnd","New Window",WS_CHILD|WS_OVERLAPPEDWINDOW|WS_VISIBLE,CRect(10,10,200,200),this->GetParent(),NULL); } And I want to show this window when pressed the button.I have wanted to do this,like this but this didnt worked:confused:. CNewWnd m_NewWnd; m_NewWnd.ShowWindow(SW_NORMAL); I am novice.how can I do this?

      B Offline
      B Offline
      Brian Shifrin
      wrote on last edited by
      #2

      But from where may I ask "this->GetParent()" is going to GetParent(), if you call it from the constructor? CNewWnd::CNewWnd(void) { this->Create("CNewWnd","New Window",WS_CHILD|WS_OVERLAPPEDWINDOW|WS_VISIBLE,CRect(10,10,200,200),this->GetParent(),NULL); }

      1 Reply Last reply
      0
      • Z zeki yugnak

        hii.. I created the window,like this: class CNewWnd : public CWnd { public: CNewWnd(void); ~CNewWnd(void); }; CNewWnd::CNewWnd(void) { this->Create("CNewWnd","New Window",WS_CHILD|WS_OVERLAPPEDWINDOW|WS_VISIBLE,CRect(10,10,200,200),this->GetParent(),NULL); } And I want to show this window when pressed the button.I have wanted to do this,like this but this didnt worked:confused:. CNewWnd m_NewWnd; m_NewWnd.ShowWindow(SW_NORMAL); I am novice.how can I do this?

        R Offline
        R Offline
        Ravi Bhavnani
        wrote on last edited by
        #3

        Brian has a valid point. Another possible problem may be the fact that you're declaring an instance of CNewWnd in your button-click's handler. m_NewWnd should be a member of the parent class. /ravi Let's put "civil" back in "civilization" http://www.ravib.com ravib@ravib.com

        Z 1 Reply Last reply
        0
        • R Ravi Bhavnani

          Brian has a valid point. Another possible problem may be the fact that you're declaring an instance of CNewWnd in your button-click's handler. m_NewWnd should be a member of the parent class. /ravi Let's put "civil" back in "civilization" http://www.ravib.com ravib@ravib.com

          Z Offline
          Z Offline
          zeki yugnak
          wrote on last edited by
          #4

          thanks for your reply. please,can you show me how to do this?. I found an example in MSDN.like this: void CMyDlg::OnCreateStatic() { CWnd* pWnd = new CWnd; pWnd->Create(_T("STATIC"), "Hi", WS_CHILD | WS_VISIBLE, CRect(0, 0, 20, 20), this, 1234); } but I cant interfere to window.

          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