Closing a CView from within 
Author Message
 Closing a CView from within

I have a CFormView that displays the progress of an iterative process.
The user can click a button on the form to halt the iterative process.
I want to shut down the CView window depending upon which options the
user chooses after halting the process.

Sending WM_CLOSE doesn't seem to do anything. How do I close a CView
from within itself?

Sent via Deja.com
http://www.*-*-*.com/



Fri, 01 Aug 2003 08:46:32 GMT  
 Closing a CView from within

Quote:
>I have a CFormView that displays the progress of an iterative process.
>The user can click a button on the form to halt the iterative process.
>I want to shut down the CView window depending upon which options the
>user chooses after halting the process.

>Sending WM_CLOSE doesn't seem to do anything. How do I close a CView
>from within itself?

Try posting the WM_CLOSE message to the view's parent window.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.



Fri, 01 Aug 2003 16:24:15 GMT  
 Closing a CView from within
Dave,

Thanks for the help. I used the code

GetParent()->PostMessage(WM_CLOSE);

and it worked perfectly!


Quote:

> >I have a CFormView that displays the progress of an iterative
process.
> >The user can click a button on the form to halt the iterative
process.
> >I want to shut down the CView window depending upon which options the
> >user chooses after halting the process.

> >Sending WM_CLOSE doesn't seem to do anything. How do I close a CView
> >from within itself?

> Try posting the WM_CLOSE message to the view's parent window.

> Dave
> --
> MVP VC++ FAQ: http://www.mvps.org/vcfaq
> My address is altered to discourage junk mail.
> Please post responses to the newsgroup thread,
> there's no need for follow-up email copies.

Sent via Deja.com
http://www.deja.com/


Fri, 01 Aug 2003 17:48:17 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Multiple CViews within one CView

2. A CView within a CView..possible?

3. Add CView within CView

4. Problem positioning a control within a CView

5. Creating a CEdit control within a CView derivesd class

6. Obtaining the CWinApp pointer within a CView function?

7. DestroyWindow() within CView then Create()???

8. (newbie)CWinApp::LoadIcon() call within a CView object

9. Creating controls within CView

10. when to close a MDI CView

11. CView being notified of close

12. How To: Prevent a CView from closing?

 

 
Powered by phpBB® Forum Software