Thread: Destroy a window and replace the contents

  1. #1
    Registered User
    Join Date
    Sep 2001

    Destroy a window and replace the contents

    I'm having problems with property pages in my MDI app, so I've decided to derive all of my 'pages' from CView, which will solve a lot of problems. There are buttons on the top of each page that when clicked will destroy the content of the window, and replace it with another form.

    I've got as far as destroying the contents with CMyFormView:estroyWindow(); but when I try CMyOtherFormView CMFV;
    CMFV.Create(... I get an error saying I cannot access protected constructors and destructors of CMyOtherFormView. What's the best way of doing this?

    As you've probably guessed it's in MFC.

  2. #2
    Registered User
    Join Date
    Aug 2001
    I would not recommend this approach but if you are persistent here it is...

    move the CMyView protected constructor and virtual functions Create into the public section instead of protected.....
    The wizard makes them protected by default....

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OpenGL vs. DirectX ???
    By Grumpy_Old_Man in forum Game Programming
    Replies: 55
    Last Post: 08-18-2003, 11:52 AM
  2. How to change window style at runtime?
    By Mr. Bitmap in forum Windows Programming
    Replies: 5
    Last Post: 06-09-2002, 04:49 PM
  3. Difficulty superclassing EDIT window class
    By cDir in forum Windows Programming
    Replies: 7
    Last Post: 02-21-2002, 05:06 PM