CPropertySheet #7

Where is the best place to add pages to a CPropertySheet object? Would it be 
where you first declare it or in the CPropertySheet class? If in the 
CPropertyClass where?
Thanks Al
-- 
Just Al
0
Al1 (451)
2/11/2007 4:28:00 AM
vc.mfc 33608 articles. 0 followers. Follow

6 Replies
449 Views

Similar Articles

[PageSpeed] 37

"Al" <Al@discussions.microsoft.com> wrote in message 
news:DFA625EF-7311-4D9B-BA27-7C39EE454F65@microsoft.com...
> Where is the best place to add pages to a CPropertySheet object? Would it 
> be
> where you first declare it or in the CPropertySheet class? If in the
> CPropertyClass where?

I do it after declaring the property sheet:

CMyPropertySheet sheet;
CMyFirstPage1 page1;
CMyFirstPage page2;

sheet.AddPage(&page1);
sheet.AddPage(&page2);
....


If you wanted to add the pages in the CPropertySheet, that would make you 
need to create CMyPropertySheet, for no other reason other than to add the 
pages.  So doing it this way saves you from doing that.

-- David (MVP)


0
dc2983 (3206)
2/11/2007 3:55:11 PM
Thanks David
I just that maybe it would be in the constructor of the CPropertySheet.
-- 
Just Al


"Al" wrote:

> Where is the best place to add pages to a CPropertySheet object? Would it be 
> where you first declare it or in the CPropertySheet class? If in the 
> CPropertyClass where?
> Thanks Al
> -- 
> Just Al
0
Al1 (451)
2/12/2007 12:01:00 AM
David Ching wrote:

> CMyPropertySheet sheet;
> CMyFirstPage1 page1;
> CMyFirstPage page2;
> 
> sheet.AddPage(&page1);
> sheet.AddPage(&page2);
> ... 
> If you wanted to add the pages in the CPropertySheet, that would make you 
> need to create CMyPropertySheet, for no other reason other than to add the 
> pages.  So doing it this way saves you from doing that.

David:

I have to say I do not understand what you are saying here. Did you mean

CPropertySheet sheet;
CMyFirstPage1 page1;
CMyFirstPage page2;

sheet.AddPage(&page1);
sheet.AddPage(&page2);

i.e. use a plain CPropertySheet?

I have never thought of doing it this way. I always derive my own 
CPropertySheet class and add the pages inside. The pages are an 
implemetation detail of the sheet, no? There is no need for the caller 
to know about them.

David Wilkinson
0
no-reply8010 (1791)
2/12/2007 10:56:20 AM
"David Wilkinson" <no-reply@effisols.com> wrote in message 
news:edplnRpTHHA.480@TK2MSFTNGP02.phx.gbl...
> David:
>
> I have to say I do not understand what you are saying here. Did you mean
>
> CPropertySheet sheet;
> CMyFirstPage1 page1;
> CMyFirstPage page2;
>
> sheet.AddPage(&page1);
> sheet.AddPage(&page2);
>
> i.e. use a plain CPropertySheet?
>

Oops, sorry, yes I meant to use a generic CPropertySheet.


> I have never thought of doing it this way. I always derive my own 
> CPropertySheet class and add the pages inside. The pages are an 
> implemetation detail of the sheet, no? There is no need for the caller to 
> know about them.
>

Well, the property sheet is really a container, the question is, do you need 
to derive a new container type?  You can get by without doing so, since you 
don't need to override any virtual methods to change the behavior of the 
container.  It's like using a CListBox to hold arbitrary items using 
CListBox::SetItemDataPtr() - you don't need to derive a new CListBox to 
manage these; the caller can.  I suppose it's a matter of how much do you 
value encapsulation vs. convenience to the caller.  Both approaches are 
legitimate, but I don't like to manage another class unless it's really 
necessary.

Thanks,
David (MVP) 


0
dc2983 (3206)
2/12/2007 3:12:20 PM
David Ching wrote:

> Well, the property sheet is really a container, the question is, do you need 
> to derive a new container type?  You can get by without doing so, since you 
> don't need to override any virtual methods to change the behavior of the 
> container.  It's like using a CListBox to hold arbitrary items using 
> CListBox::SetItemDataPtr() - you don't need to derive a new CListBox to 
> manage these; the caller can.  I suppose it's a matter of how much do you 
> value encapsulation vs. convenience to the caller.  Both approaches are 
> legitimate, but I don't like to manage another class unless it's really 
> necessary.

David:

Aren't "encapsulation" and "convenience to the caller" on the same side 
here? It's "lazy implementer" that is on the other side, no? :)

Seriously, if I decide to move a field from one property page to 
another, I shouldn't have to change the client code.

David Wilkinson
0
no-reply8010 (1791)
2/12/2007 3:59:00 PM
"David Wilkinson" <no-reply@effisols.com> wrote in message 
news:e0jRv6rTHHA.5060@TK2MSFTNGP02.phx.gbl...
> Aren't "encapsulation" and "convenience to the caller" on the same side 
> here? It's "lazy implementer" that is on the other side, no? :)
>
> Seriously, if I decide to move a field from one property page to another, 
> I shouldn't have to change the client code.
>

David, I guess the core of the code goes into the property pages, not the 
sheet.  For example, in the case of wizard mode, the next/previous page is 
determined by the active page, not the sheet, when the Next/Back button is 
clicked.  So there is precious little of value in any CMyPropertySheet 
class.

Also, it doesn't save the client that much by having it.  The client needs 
to add the files for all the pages into the project, so already it's not 
like you're having one reusable object if you try to expose a derived sheet.

Still, I get the point of what you're trying to do.  In fact, in rare cases, 
I have created a CMyProperySheet class when the pages that got added varied 
depending on some condition.  Normally, though, the implementation details 
negate much of the encapsulation benefit, and I just don't think it saves 
the client enough to warrant managing a CMyPropertySheet class.

Thanks,
David (MVP)


0
dc2983 (3206)
2/12/2007 4:58:17 PM
Reply:

Similar Artilces:

windows auth login problem with windows 7
I jsut set up a new windows 7 machine. Previously running all my dev work on XP. I know there are issues with SQL 2005 in Windows 7. When I oepend up SSMS to log into SQL I could use SQL authentication but not Windows authentication. (I do have it set for mixed mode). I've never had this issue with XP. I can either use widows auth or sql auth. Either way it works fine. Far as I know I have SQL set up the same way on both machines. Any ideas? Thanks, Keith Keith G Hicks Hmm I have neve seen that problem when I connected to SS2005/2008 . What if you right click on S...

CPropertySheet
hi i am working in a dialog based MFC appwizard project. I have created a wizard from CPropertySheet( 6 pages). In my fist page i want the user to select the working directory when the user clicks a browse button. for that i have used SHBrowseForFolder. i want the next button in the first page to be enabled only if the user selects a folder and clicks the ok button. i have included the following code in OnSetActive() function of the first page CPropertySheet* parent =(CPropertySheet*)GetParent(); parent->SetWizardButtons(PSWIZB_NEXT); I am able to hide the Help button from all...

Vista 64 to win 7 32
Can I upgrade install a Windows 7 32 bit into a PC with Vista 64 bit? On Mon, 14 Dec 2009 15:24:20 -0600, "Merle" <merle_deneen@hotmail.com> wrote: > Can I upgrade install a Windows 7 32 bit into a PC with Vista 64 bit? No. You can never change from 32-bit to 64-bit, or vice-versa, via an upgrade. -- Ken Blake, Microsoft MVP (Windows Desktop Experience) since 2003 Please Reply to the Newsgroup Thanks for the quick response. I guess I have to do a clean install then Huh "Ken Blake, MVP" <kblake@this.is.an.invalid.domain> wrote i...

help #7
> hi, i am creating a user-system for my ICT coursework, and i have created a > customer database and a sign up form on 2 seperate sheets, what i need help > with is the code so that i can create an ok button, then once it is pressed > all the text that has been entered into the sign up form, is copied over > into the customer database, and also it goes onto the next row if a second > sign up is done. > > many thanks > > Shaun --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.580 / Virus Database: ...

CDateTimeCtrl #7
How can I allow the user to blank out a date in the control after it has already been entered? Hi, You can use CDateTimeCtrl::SetFormat(" "); to blank out your control. Hope this will help. Geo >-----Original Message----- >How can I allow the user to blank out a date in the control after it has >already been entered? > > >. > ...

FRx 6.7 vs 32-bit Windows 7
I'm getting the following error when trying to generate a report but only on the Windows 7 32-bit system. Running SQL Server 2005 on another server, Dynamics GP 9 client is installed on this machine. Component Error FRx is unable to process this output request for the following reason: C:\Windows\system32\msxml.dll could not be found. Generating a DrillDown Viewer or XML output file requires the following: -Microsoft Internet Explorer 6.0 or later -MSXML 4.0 SP1 or later It may be necessary to install (or reinstall) the component or components listed above. ** any suggestions or re...

Outlook Express Error Message #7
Can't open Outlook Express, I get an error message from Microsoft regarding this file c:\\document\owner\locals~1\temp\werae0.tmp.dir00 \appcomtat.txt ...

GP 7.5 to 9.0 upgrade failed during "Load Table Auto Procs"
Hi, Upgrading a client from GP 7.5 (SP6) SQL to 9.0 In the "Server Installation Progress" window (normal upgrade in GP Utilities) During "Updating database: xxxxxx" in step "Load Table Auto Procs" We receive the message (window title: Microsoft Dynamics GP Utilities): "The stored procedure UpdateDB_Upgrade() of form duSQL Pass Through SQL returned the following results: DBMS: 12, Microsoft Dynamics GP: 0." with the OK button. Responded to the message 4 times, then... "Microsoft Dynamics GP Utilities install/upgrade failed." Anyone run ...

Queues #7
Currently the exch2k3 server has 3500 messages in the queues folder. How can I manually clear the queue? Also, in the ESM, there are 1100 queues. Can I manually clear those as well? Thanks ...

New Exchange Mail Account in Window 7
I am using Win 7 (64-bit) and have installed Office 2010 beta (64-bit). I am trying to install a user in Outlook 2010 to use an existing Exchange account. I am being told I need to open the User tab in Control Panel and under the profile I need to add to go to Mail. I cannot find the Mail portion of the User profile in Win 7 Control Panel. I had a similar situation in Vista 64 using Outlook 2007, but then I found the place to add an Exchange mail user in the Control Panel 32-bit section. I am going in circles, please help me stop. Resolved "Michael P" wrote: > I...

blocked attachment #7
I have a user with outlook 2003 The user gets emails from our customer that has an attachment. The extension of the file is .snp Never had a problem with this before. But now, when looking in her inbox, it shows that there is an attachemnt, but she cant view it. If I R-Clcik on teh email and selct view, it shows teh file. If I try to open, it wont, if I tray to save it to teh desktop, I get a message saying Outlook can't save teh file. This was workign just fine earlier today, and emails recieved yeterday can still be opened fine. Restarted teh machine, no luck. Any ideas...

Calendar not displaying free/busy info after 7/1/2004
We just discovered an issue on our Exchange 5.5 Server where our Free/Busy time is not showing for any user in the organization after 7/1/2004. Any ideas? Outlook only publishes 2 months of free/busy data, go into Tools > Option in Outlook at you will find the option to increase it. -- Mark Fugatt Exchange MVP http://www.exchangetrainer.com http://www.msexchange.org "dburnell" <anonymous@discussions.microsoft.com> wrote in message news:93C9B563-A7D2-4B5B-85F7-1565D31744BF@microsoft.com... > We just discovered an issue on our Exchange 5.5 Server where our Free/Busy ...

MSFlexGrid killing parent CPropertySheet
Hello, I am very new to VC++ and COM in general. I am developing an ActiveX control which is basically - 3 Tabs with grids on them. I used dialog resources and added 3 CPropertyPage derived classes to be my tab pages by adding the the each them one-by-one to an instance CPropertySheet. This far, things work ok. I added MSFlexGrid control to my project and it generated a couple of classes. I don't see anything wrong with that either. I placed a MSFlexGrid control on one of my Dialogs and that's where problems started. If I click on the tab where I placed the grid in the designer...

Macros #7
Hi, Need to create a macro so that when cell A2 contains value of 1(for example) in it, the cursor moves to a new cell address (like D200) Need also a macro to print a sellection (range of cells) in a spreadSheet. Thanks in advance Khali Handal Hi Khalil, >Need to create a macro so that when cell A2 contains value of 1(for >example) in it, the cursor moves to a new cell address (like D200) for example: If Range("A2").Value = "1" Then Range("D200").Activate > >Need also a macro to print a sellection (range of cells) in a spreadSheet. try:...

Dynamics SL 7 Compatibilty Level issuse
Hi there, We are using Dynamics SL 7.0, SQL Server 2005, Windows 2003 R2 server I try to create Pivot query and I got error says: Msg 325, Level 15, State 1, Line 6 Incorrect syntax near 'PIVOT'. You may need to set the compatibility level of the current database to a higher value to enable this feature. See help for the stored procedure sp_dbcmptlevel. I checked and the current compatibility level is 2000 (80) I look at article ID 922650 Q6. Can Microsoft Dynamics SL databases run with a compatibility level of SQL Server 2005 (90)? A6. No, Microsoft Dynamics SL databases should r...

subtitle .srt with WMP 12 in Windws 7
Hi i recently upgraded to Windows 7 from Vista home premium, since i have the new OS i sow that WMP is different, indeed it's the version 12, it's better as video quality, but i can't see no more displayed my subtitle (.srt) when i watch file video (.avi). I've always named the two files with the same name in the same folder, but now it doesn't work no more.. it works with VLC, but the quality of WMP is much better.. Can you help me to solve this problem? "Francesco" wrote: > Hi i recently upgraded to Windows 7 from Vista home premium, since...

Send As #7
I have given a user "send As" perm directly on a universal distribution group in AD. However, whenever this user slects the group from the GAL in the "From:" field of Outlook 2k3 and attempts to send an email as that group, he gets an error of "You do not have the permission to send the message on behalf of the specified user". The group is NOT nested in any of the AdminSDHolder protected groups. The user has been given "send as" perms directly on the UDG. He is in no groups with expilict denys. I have also tried giving my account "send as&quo...

Earn $200 per day without a website
Tired of wasting your time & hard earned money on "intelligent" programs which promise to make you rich overnight? Then read on, because I am going to show you............. How I made over $2000 in just 10 days using a ridiculously stupid technique I stole from my own affiliate Click the following link to see the entire procedure explained step-by- step. http://www.showroute.com/odp I Got MY Own ATM. J http://www.showroute.com/odp Wilson. ...

Publisher Problem #7
We recently bought a new HP Probook 4710s laptop. Every time we hit send/receive in Outlook, Publisher starts to reinstall itself. We have uninstalled and reinstalled Publisher but the same thing happens. Any suggestions? Thanks, -- Hank M Take a look at the following article. Information about using 2007 Office suites and programs on a computer that is running another version of Office http://support.microsoft.com/kb/928091/en-us -- Mary Sauer http://msauer.mvps.org/ "HankM" <HankM@discussions.microsoft.com> wrote in message news:203692CD-3D60-477C-9BDC-0235BA1E2AA7...

Open relay #7
Hello! We have a w2k server with Exchange 2000, and i am affraid someone can relay on it. I have enabled logging, and in the file I found this: 2004-10-14 09:37:20 64.236.224.39 OutboundConnectionResponse - 220+********0********************************** 2004-10-14 09:37:20 64.236.224.39 OutboundConnectionCommand - w2kexch.ED.local 2004-10-14 09:37:20 64.236.224.39 OutboundConnectionResponse - 500+Syntax+error,+command+unrecognized 2004-10-14 09:37:20 64.236.224.39 OutboundConnectionCommand - w2kexch.ED.local 2004-10-14 09:37:20 64.236.224.39 OutboundConnectionResponse - 250+OK 2004-...

lost emails #7
Hi, My computer was hit by lightening a couple of months ago and even the technician could not get the hd working. It is completely dead. We need to extract some emails that concern a lawsuit. The emails are from an old internet service and from 2005. Does anyone know how I can find these emails another way? Thanks, kpdeg On 13 Sep 2006 07:14:09 -0700, "kpdeg" <kpdegrave@alphacomm.net> wrote: >My computer was hit by lightening a couple of months ago and even the >technician could not get the hd working. It is completely dead. We >need to extract some emails...

Tabs in CPropertySheets
I am having 3 pages in a PropertySheet and I have added two pages in between 1st page and 2nd page. Now newly added pages are having taborder 2 and 3 respectively. But the problem is that, I want to display tabs...1,2,3 in a row. But they are not displaying. When I decrease caption size of 2 and 3 pages then these 1,2,3 pages are displaying in a row. But if I decrease caption size there is no meaning for 2 and 3 tabs. How can I solve it ? (I must have to use scrolling tabs). Please send your reply to mvs.ravikumar@wipro.com The display is like this: (3rd page )(4th page)(5th p...

OT: Windows 7 (XP with a new look!)
What a heap of crap, ...not just Windows 7 but, also the Asus X5DIJ laptop that I just bought for my Aunty !!! Having just finished a late shift at work, I thought I'd run the Asus "Recovery Disc Creation" procedure, (Laptop arrived this morning, just before I had to go to work), so that it gets done. ....ready for when I take it in to her tommorrow morning. The supplied "AI Recovery" has been running for over 45 minutes, first creating a backup image, then ISO files, ....then it finally burnt the 1st ISO image to DVD+r ...or they may be -r' disc...

Mailbox Size #7
How can I check how much space a users mail is taking up? I currently dont have mailbox size limits and I dont really want to have to use them. Id just like to know how I can see which users are using what space as I think some users on the network may be taking up ridiculous amounts of space. Hi Open ESM, navigate to the Mailbox Store, ->Mailboxes, You can sort by "Mailbox Size" Regards, Shai Netanel If my answer help you please click "YES" "JB" wrote: > How can I check how much space a users mail is taking up? > I currently dont have mailbox ...

Any Windows 7 News Groups
Hi Folks I have Windows 7 Ultimate and can create the god command folder Rename the folder and paste in the following text: GodMode.{ED7BA470-8E54-465E-825C-99712043E01C} However, my niece in Vancouver running Win 7 Home premium cannot Any ideas? Uncle Gus None hosted by Microsoft, but they do have an online forum: http://social.technet.microsoft.com/Forums/en-US/category/w7itpro "Uncle Gus" <gush@REMOVEcox.net> wrote in message news:euEJgIarKHA.732@TK2MSFTNGP06.phx.gbl... > Hi Folks > > I have Windows 7 Ultimate and can create the g...