Help deleting a page from CPropertySheet

I have a CPropertySheet derived class called CAddTenantSheet. The
following code creates the sheet fine.

CAddTenantSheet sheet;
CAddTenantPage1 m_page1;
CAddTenantPage2 m_page2;
sheet.AddPage(&m_page1);
sheet.AddPage(&m_page2);
sheet.SetWizardMode();
sheet.DoModal();

I would like to know how to delete m_page2 during the call to m_page1.
Once I get the code working, I will use it to delete sheets that
aren't needed, based on yes/no responses on earlier sheets.

At the moment, may OnInitDialog() function in CAddTenantPage1 is

BOOL CAddTenantPage1::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();
	((CPropertySheet*)GetParent())->SetWizardButtons(PSWIZB_NEXT);	
        ((CPropertySheet*)GetParent())->RemovePage(1);
	return TRUE; 
}

The first line hides the back button of the page, and this works fine.
However, the next line, RemovePage(1), causes a memory leak. Similiar
behaviour occurs if I override OnSetActive() instead of OnInitDialog()

If I change my original code to 
CAddTenantSheet sheet;
CAddTenantPage1 m_page1;
CAddTenantPage2 m_page2;
sheet.AddPage(&m_page1);
sheet.AddPage(&m_page2);
sheet.RemovePage(1);
sheet.SetWizardMode();

(and don't override OnInitDialog of CAddTenantPage1), then only the
first sheet is displayed. However, I need to be able to dynamically
delete sheets.

Any ideas/comments ?

Regards

Patrick
0
p_rynhart (9)
12/17/2003 10:30:16 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
809 Views

Similar Articles

[PageSpeed] 56

How about RemovePage...

--
Frank

"Patrick Rynhart" <p_rynhart@hotmail.com> wrote in message
news:7ad0ef0a.0312171430.4e636930@posting.google.com...
> I have a CPropertySheet derived class called CAddTenantSheet. The
> following code creates the sheet fine.
>
> CAddTenantSheet sheet;
> CAddTenantPage1 m_page1;
> CAddTenantPage2 m_page2;
> sheet.AddPage(&m_page1);
> sheet.AddPage(&m_page2);
> sheet.SetWizardMode();
> sheet.DoModal();
>
> I would like to know how to delete m_page2 during the call to m_page1.
> Once I get the code working, I will use it to delete sheets that
> aren't needed, based on yes/no responses on earlier sheets.
>
> At the moment, may OnInitDialog() function in CAddTenantPage1 is
>
> BOOL CAddTenantPage1::OnInitDialog()
> {
> CPropertyPage::OnInitDialog();
> ((CPropertySheet*)GetParent())->SetWizardButtons(PSWIZB_NEXT);
>         ((CPropertySheet*)GetParent())->RemovePage(1);
> return TRUE;
> }
>
> The first line hides the back button of the page, and this works fine.
> However, the next line, RemovePage(1), causes a memory leak. Similiar
> behaviour occurs if I override OnSetActive() instead of OnInitDialog()
>
> If I change my original code to
> CAddTenantSheet sheet;
> CAddTenantPage1 m_page1;
> CAddTenantPage2 m_page2;
> sheet.AddPage(&m_page1);
> sheet.AddPage(&m_page2);
> sheet.RemovePage(1);
> sheet.SetWizardMode();
>
> (and don't override OnInitDialog of CAddTenantPage1), then only the
> first sheet is displayed. However, I need to be able to dynamically
> delete sheets.
>
> Any ideas/comments ?
>
> Regards
>
> Patrick


0
12/18/2003 2:47:04 AM
Reply:

Similar Artilces:

New page on Video Carrdds
I have created a new page on video cards from my forum and from my reviews etc. Lots of helpful information with more to come. Vendor neutral its meant to be helpful without a vendor calling the shots. -- http://contract-developer.dyndns.biz ...

Emptying 'Deleted Items' folder on exit
I am running WLM version 2009 (Build 14.0.8089.0726) on Windows 7 with all the latest updates. I have 'Empty messages from the Deleted Items folder on exit' checked under Maintenance, but they're all still there when I exit and restart WLM. Is there another setting I should be looking at to make this work? TIA, -- SC Tom Tom, I experienced the same thing earlier today. I'm new to WLM and found that if you "checked" the ''Empty messages from the Deleted Items folder on > exit' after there were items in the Deleted Items folder, it ...

Formula Help (to many expresions)
Could one of you give me a hand with this... I'm trying to put a formula in a spreadsheet that has too many expressions in it. I understand there is a limit to the number of equations that can be in a formula but there must be a way around the cap. Or maybe another way to write the formula? What I am trying to say in the formula is that if... If X is less than 09 then B1 = what's in cell C2 If X is less than 25 then B1 = what's in cell C3 If X is less than 51 then B1 = what's in cell C4 The expression I have written looks like this... =IF(X<10,"N/A",IF(X<...

How do I get deleted items that stay in inbox with line thru them.
I inherited a computer at work. Outlook is setup so that when I delete a message it stays in the inbox, with a line thru it. How do I get the deleted items to go automatically to the deleted item folder? "rwwhit" <rwwhit@discussions.microsoft.com> wrote in message news:7D17761E-CD1B-4D04-BACB-B0D837C4DD93@microsoft.com... >I inherited a computer at work. Outlook is setup so that when I delete a > message it stays in the inbox, with a line thru it. How do I get the deleted > items to go automatically to the deleted item folder? That's normal behavior...

mscvr71.dll help
How do I make my VS.net 2003 software not depend on msvcr71.dll? Thanks. Use static linking. I don't know where to set the option in VS7, but it used to be under Code Generation where you selected the desired C runtime library to use. In VS6 we had a choice between a dynamically-linked runtime and a statically-linked runtime. I've not had to make this choice under VS7 so I'm not sure where, in their overly-clever and completely gratuitous reimplementation of the user interface, this has been hidden. joe On Sat, 21 Feb 2004 22:24:56 GMT, anonymous@coolgroups.com wrote: &g...

Excel 'hangs' when deleting a row
when i delete a row in excel 2000, everything locks up! and when lookup at Task Manager/Processes, it's MEM USAGE goes up to 22K o more! i tried doing it in another file but i experienced no error. the dat is in LAN. all data are filtered when the deletion began. however i ca delete files before. please help, anyone.... -- Message posted from http://www.ExcelForum.com The best thing is to free up memory (assuming your file is large). Clos all applications you do not require at the time and any workbooks no in use. Dunca -- Message posted from http://www.ExcelForum.com ...

Using a VBscript to copy/delete/move Outlook messages
I need to write a VBscript to: - open my Outlook (2000 or XP) mailbox - read the list of the folders in either the Exchange Mailbox and in local ..pst files - open each folder and subfolders - read information about messages (i.e. sender, recipient, creation date, and so on) - move, copy or delete messages based on the above information Can anybody please provide a pointer to a sample I can start from? Regards Marius ...

IE8 was deleted from my windows 7 and I cannot find correct downlo
I have a two month old Toshiba and deleted IE8 because of crashes. Trying to find the correct download to reinstall. The IE8 homepage just says it is included in windows 7 but does not show the download file....... ARRRG. Tried Vista IE8 download file but message says it not the correct operating system. On Sun, 21 Mar 2010 20:50:01 -0700, pawntonian <pawntonian@discussions.microsoft.com> wrote: >I have a two month old Toshiba and deleted IE8 because of crashes. Trying to >find the correct download to reinstall. The IE8 homepage just says it is >included in wind...

Help with ShowFilter Macro
I'm trying to use this ShowFilter UDF written by Tom Ogilvy (see bottom of post). It says to use... =showfilter(B2)&CHAR(SUBTOTAL(9,B3)*0+32) ....in a cell to show the criteria for Column B. For one thing, I don't understand the cells B2 and B3 business. What is supposed to be in those cells? I would like this function to appear in the cell directly above or below the Autofilter menu cell. How do I change the function if the Autofilter criteria menu is in, cell A3, for example, and I want the criteria (this function) to appear just above, in cell A2? After trying all so...

How to delete duplicate data
Hi, I am using excel to consolidate monthly room booking data. I have a date column and time column. May I know how to to delete those rows which contains duplicate data with same date stated in the date columnand and same time range in the time column? Thank you. Data>filter>advanced filter, unique records only and copy to another location -- Regards, Peo Sjoblom Excel 95 - Excel 2007 Northwest Excel Solutions www.nwexcelsolutions.com (Remove ^^ from email) "PL" <PL@discussions.microsoft.com> wrote in message news:F45DAE2B-252D-4E17-81D8-0F4C060BCB21@m...

Can you delete and empty an open email
Hi there Can you delete and empty an open email? I know I can delete and empty a closed email by holding down shift and then deleting, but have not been able to figure out how to delete and empty from an open email. Is this even possible? Thanks for your help. Kylie On Wed, 18 May 2005 20:01:03 -1000, Kylie B"" <KylieB@discussions.microsoft.com> wrote: > Hi there > > Can you delete and empty an open email? I know I can delete and empty a > closed email by holding down shift and then deleting, but have not been > able > to figure out how to delet...

Help with automating file name
I have the following code that exports the below query to excell. I would like the files name to include the month and date. How would I format this? DoCmd.OutputTo acOutputQuery, "qryShopOrderSqFtShippedSummaryExport",_ acFormatXLS, "W:\Cokato\Production\ProdRoomRpt.xls" -- Matt Campbell mattc (at) saunatec [dot] com Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200708/1 Hi, Matt. > I would > like the files name to include the month and date. Uh, . . . the date _always_ includes the month, unless you're r...

Please help with last formula for order form.
I am able to accomplish this with 1 column by the formulas below. Cell H160 is the subtotal: =IF(SUM(H72:H111)>0,SUM(H72:H111),"") Cell H166 the total: =IF(SUM(H160)>0,SUM((H160*H163)+H160),"") Cell H163 is for Tax. I am almost finished creating an order form. I would like to get the SUM of 3 different columns that are separated. I am not able auto fill strait down the column, because the information is separated in groups with titles, and the cells are not identically sized. I tried varations of this formula: =IF(SUM(H72:H111)+(116:131)+(135:154)>0,SUM ((H72:H...

deny ability to delete sent items
Environment is Win2k3 Server and Exch2k3. We would like to impliment a Group Policy that would remove users ability to delete the items in their Sent Items folder. It would be OK if items could be removed after Archiving if necessary. It appears that deleted Sent Items do not go to Deleted Items folder, so dumpster retention policy doesn't seem to be a solution. Any ideas? I am 99.9% certain that this is not possible through group policy. I'm very certain that while it might be possible, it would be extremely difficult to implement and manage. -- Ed Crowley MVP - Exchange &quo...

Need Hyperlink from Menu Page to work in email
I have a workbook with several tabs. First tab is a "menu" type page (summary of other pages). Currently I have hyperlinks to all the other pages from the menu page. What I want to be able to do is copy the menu page into an email and enable the users to click on the existing hyperlinks (whatever adjustments needed) to go directly to their page of the workbook. Using Excel 2007. Please advise how to do this and what changes may be need for both options to work. ...

SmartList Restrictions help
I built a SmartList that is based on the Year-to-Date Transaction Open file, and has the Account Master linked to it. I want to restrict it to accounts that begin with 36, 38, or 2504. I tried adding a restriction that says "Account Number:Account_Segment_Pool1 begins with 36 OR 38 OR 2504", but I got no results when I did it that way. I also set up 3 separate restrictions, but that didn't work either. Is this possible? I can't find much information about how to write restrictions in SL Builder. ...

Conditional formatting help #4
My problem is that, that i want to ignore blank i mean i had set a conditional formatting say A B C D 24.9 25.9 25 25.8 22.6 23.4 22.5 23.3 If value in ColA is less than value in ColC, cell A1 is shaded blue OR if value in ColB is greater than value in ColD, cell B1 shaded blue. I have done above formatting but my problem is that if i dont enter anything in colC then also colA is shaded in blue similarly if i dont enter any value in colD then also col B is shaded.I mean i want to ignore the blank.I need , if col C is blank then the Col A must be normal .& if col D is blank & i ent...

help plz
my account has been inactive how to i reacctivate it? What account and what does this have to do with Outlook? "heather" <tracyliepke@yahoo.com> wrote in message news:066001c36c53$bb68d180$a501280a@phx.gbl... > my account has been inactive how to i reacctivate it? ...

Help with queries
Hi Guys, This is the first time after school that I am trying to use ms access at work and i need ur help in creating a query. Any help will be highly appreciated!! Here is what I need... I have relatively small ms acces database with about 1000 I have 3 colums date ipaddress sitename 12/09 34.3.3.3 A 12/09 34.3.3.3 A 12/09 34.3.3.3 A 12/09 33.4.4.4 B 12/09 33.4.4.55 C What i need is if an ipadress is recorded more t...

Both sides of a report page
Is there a way to utilize both sides of a report page as if printing a book? On Wed, 9 Jan 2008 08:06:03 -0800, TRS <TRS@discussions.microsoft.com> wrote: >Is there a way to utilize both sides of a report page as if printing a book? Yes. But it is dependant on the printer your using, not on Access. Chuck -- ...

Open web page from Word 2007
I have the following code to open a web page: Dim IE Set IE = CreateObject("internetexplorer.application") mySTR = "http://MyWebPage" IE.Navigate mySTR The code works if I run it from vba - it opens the page on top of Word. But if I assign it to a QAT or Ribbon button, it opens the page but leaves it minimized. How can I get it to open on top of Word? ...

Problem with printing listbox bigger than one page
Hi, I created form "Invoice". It contains few list boxes (like: Brand, Product, Price, etc.). Each list box is big enough to display 50 items. It works in this way: user is chosing product from table Products_tbl and clicks on "Add to invoice" button which adds to each list box new item containg apropriate information about chosen product. At the end, user can print the form. Before it was limited, and user could put max. 50 products on one invoice, but I wanted to get rid of this limitation. I did it in this way: after 50th item, with each added product I extend list boxe...

Need help to choose loyalty program integrated with website
Hello. My name is Alex and I am working for franchise company using RMS system. We are looking for loyalty program integrated with web store. We have 12 franchisee stores using RMS and they are all conneted to our HQ system in main office. We want customers to earn point for each sales and redeem their points only at our website. (not on off-line store) Can anybody recommend best solution for our plan? Thank you. ...

How do i apply a background to only half the page?
How do i apply a background to only half the page? clueless wrote: > How do i apply a background to only half the page? ================================ One way would be to add the background and then create a text box / resize it and reposition it to cover half of the page and type Ctrl+T to make it opaque (white). -- John Inzer MS-MVP Digital Media Experience Notice This is not tech support I am a volunteer Solutions that work for me may not work for you Proceed at your own risk How about filling a rectangle or text box? -- Don - Publisher 2000 Vancouv...

Help And Advive For A Novice
HELP AND ADVICE FOR A NOVICE This Is Not A Question About Using Excell But How To Download E -books I Have Purchased 2 E-books (a)f1 Excell And (b) Financial Statements. Encountered Difficulty In Downloading Because The Instructions Were Not Very Clear For Novice And Message Flagged Up "zip File Corrupted" I Have Utilised My Permitted Downloads. Therfore I Have Not In A Position To Use The E-books -- Joe Williams ------------------------------------------------------------------------ Joe Williams's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=23...