Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Visible CFrameWnd wanted...

Posted on 1997-10-23
1
Medium Priority
?
441 Views
Last Modified: 2013-11-20
this is a rather annoying problem...one that an expert in MFC will no doubt be able to answer in 5 seconds.
Put simply as possible, I have an SDI application in which, on a certain menu command, I want to pop up another frame window which displays some information.  I have derived my own class from CFrameWnd, implemented a simple message map which handles WM_PAINT, and added a constructor which calls the Create() and ActivateFrame() functions.  Then, I added a menu command and a handler in my view class which creates a new object of my class. and what do I get? nothing! not a single pixel.  What exactly am I missing here?
0
Comment
Question by:openGL
1 Comment
 
LVL 10

Accepted Solution

by:
RONSLOW earned 40 total points
ID: 1308705
Try a CMiniFrameWnd - I use this for displaying a modeless property sheet.

I create mine like something like this

BOOL CMyMiniFrameWnd::Create(CWnd* pParentWnd, CRect rect) {
      return CMiniFrameWnd::Create(
            NULL,"My Title",
            WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU | MFS_MOVEFRAME | MFS_4THICKFRAME,
            rect,pParentWnd,0
            );
}

Then I create a property sheet (you could create a CWnd to do it all yourself, or a CListCtrl or CEdit or whatever) that lives inside it.  The inside wnd knows how to draw itself etc.

NOTE: If you know the rect for the inner window, then the frame can work out its own size required to contain this window like this...
      CalcWindowRect(rect);
      MoveWindow(rect,false);

0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question