Solved

Visible CFrameWnd wanted...

Posted on 1997-10-23
1
414 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 10 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

863 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

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now