Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to make a CMDIChildWnd pop-up?

Posted on 1998-05-12
4
Medium Priority
?
397 Views
Last Modified: 2013-11-20
My application has one doc and two views. One view is used to display picture in normal size and the other view is used to display the same but zoomed picture. I hope the latter view can keep TOPMOST. But since the CMDIChildWnd cann't have a WS_POPUP style, how should I do? Thanks!
0
Comment
Question by:zhpch
[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
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
piano_boxer earned 200 total points
ID: 1309944
You need to create a new frame window class for the view. CMDIChildWnd is only designed to be a child of the main app-window.

Derive a new frame class from CMiniFrameWnd. Override PreCreateWindow of it:

BOOL CTopFrame::PreCreateWindow(CREATESTRUCT& cs)
{
    cs.dwExStyle |= WS_EX_TOPMOST;      
    return CMiniFrameWnd::PreCreateWindow(cs);
}

Theres is some problems to solve:
 1. The frame does not activate correct.
 2. There is a seperate menu in the top-most frame.
0
 
LVL 11

Expert Comment

by:mikeblas
ID: 1309945
Your override is incorrect.  You should code:

BOOL CTopFrame::PreCreateWindow(CREATESTRUCT& cs)
{
   if (!CMiniFrameWnd::PreCreateWinodw(cs))
      return FALSE;

   cs.dwExStyle |= WS_EX_TOPMOST;
   return TRUE;
}

.B ekiM

0
 
LVL 4

Expert Comment

by:piano_boxer
ID: 1309946
mikeblas: Hmmm. What I did works, but OK.
0
 
LVL 11

Expert Comment

by:mikeblas
ID: 1309947

works != correct


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

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

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