[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

How do I get my child window of a CWnd object to display?

Posted on 1998-01-28
2
Medium Priority
?
376 Views
Last Modified: 2013-11-19
I know I'm most likely missing some fundamental knowledge here, but I have a CWnd object (unfortunately, it's not a CMDIFrameWnd or even a CFrameWnd), can I create a visible child using Create() or CreateEx()?  I create an instance of an oject derived from CWnd, and the call its Create() function giving it a parent.  I then call show and update, I declare the window style as WS_CHILD | WS_VISIBLE so I'm not sure I need to do this, but anyway I don't see the window.  I'm not sure how MFC handles the message loop.  Is is running in CWinThread?  Do I need to create my own so that the window will update? I've been used to dealing with only MDI child windows and never had to implement this stuff with MFC.  Any help would be greatly appreciated.

Thank you.
0
Comment
Question by:jmaresca
[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
2 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 480 total points
ID: 1315094
Did you specify a valid visible rectangle for the window? You should double check to see if the window has been created or not by using Spy++. With Spy, you can see if the window was actually created and its location. From that, you should at least see if the window has been create or not.

If you call Create and it returns TRUE, then you can be sure that the window creation succeeded. So I suspect it is probably off the screen or clipped by the window somehow.
0
 

Expert Comment

by:krw
ID: 1315095
I struggled with this one for a while before I figured out what I was doing wrong.  If your application is an MDI one (as mine was in the same scenario), your child window must be derived from CMDIChildWnd to interact with the framework correctly.  CWnd, nor CFrame will work; they will be created but obscured by the CMainFrame window.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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 this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

650 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