Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Visible CFrameWnd wanted...

Posted on 1997-10-23
1
Medium Priority
?
435 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

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…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

721 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