Show New Window
-
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?
-
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?
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); }
-
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?
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 -
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.comthanks 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.