Destroy a window and replace the contents

This is a discussion on Destroy a window and replace the contents within the Windows Programming forums, part of the Platform Specific Boards category; I'm having problems with property pages in my MDI app, so I've decided to derive all of my 'pages' from ...

  1. #1
    Registered User
    Join Date
    Sep 2001
    Location
    England
    Posts
    121

    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
    Posts
    223
    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....
    zMan

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, 04:06 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21