Solved

Visible CFrameWnd wanted...

Posted on 1997-10-23
1
412 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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Rewrite URL With Encoded Characters 6 64
if loop in java 3 113
sumHeights2  challenge 7 75
Problem to open Excel file 15 35
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…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 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

8 Experts available now in Live!

Get 1:1 Help Now