Solved

Visible CFrameWnd wanted...

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Adapt this command to show who installed 29 108
how to monitor remote shell execution on linux 9 100
sameEnds challenge 3 157
withoutTen challenge 14 119
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

805 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