Solved

Displaying Property Pages as individual Dialogs

Posted on 1998-06-11
6
181 Views
Last Modified: 2013-11-20
I'm creating an application in which I would like to display certain pages as both individual dialog boxes, and as
the tabs of a property sheet. The user would be able to choose if they wanted them all together or not.

So, I created the pages as descendants of the CPropertyPage class... which is itself a descendant of CDialog.
But when I try to display the pages individually by calling DoModal(), it just crashes and won't display anything.

Any tips would be greatly appreciated.
--Anthony (ajnicholson@lucent.com)
0
Comment
Question by:nicholso
[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
  • 3
  • 2
6 Comments
 

Author Comment

by:nicholso
ID: 1317860
Adjusted points to 200
0
 
LVL 1

Expert Comment

by:motigust
ID: 1317861
You did the right thing.
It should work, maybe somthing else is wrong.

Were does it crushes? Which function?
Can you give an example of that point in your code?


0
 

Author Comment

by:nicholso
ID: 1317862
i tried it with a different dialog box and it works now. I don't know what the problem was.
Thanks for your time!

Anthony
0
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!

 
LVL 3

Accepted Solution

by:
shaig earned 200 total points
ID: 1317863
Acording to the MFC documentation CPropertyPage inherits from CWnd rather then from CDialog.
What i do is create ( DoModal() ) a property sheet with a single page instead of playing with dialog boxes, infact i can't remember when was the last time i used a dialig box. your thinking is right, CPropertyPage gives you modularity.

does this solution suit you?
0
 

Author Comment

by:nicholso
ID: 1317864
shaig:
 Your solution does work, but it looks silly because you have a window with a titlebar, then it has only 1 tab with the same title on it... is there any way to get the property
sheet you have created with only one page to not have a tab at the top?

Also, can you center the OK,Cancel,Apply buttons?
thanks
anthony
0
 
LVL 3

Expert Comment

by:shaig
ID: 1317865
I'll start with the buttons:
You can do whatever you want with the buttons ( including hiding them ) if you do this:

//sample code from the sheet's OnInitDialog
CWnd *pWnd = GetDlgItem( IDOK );
pWnd->MoveWindow( centerCordinates );
or:
pWnd->ShowWindow( SW_HIDE );

do the same with cancel, apply and help.
regarding the tab:  i don't have a clean solution. you can move the tab control up so the sheet's title bar will hide the sub-title, this can be done this way:
CTabCtrl *pTab = GetTabCtrl();
pTab->MoveWindow( reduce the y, cy condinates )

hope i've helped.

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MFC Dialog 9 54
Adapt this command to show who installed 29 114
only14 challenge 19 89
moto 4g phone enable finger print 4 73
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.
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.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

734 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