Solved

Want to add Property Page at runtime to Property Sheet

Posted on 2008-10-12
11
574 Views
Last Modified: 2013-11-20
Hi,

I am new to VC++ and Win32 Programming

i want to add Property Page at runtime to Property Sheet. Please help me to implement this. Please give some link in codeproject or some other ready made solution so that i can understand from there.


thanks
0
Comment
Question by:palhade
[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
  • 5
  • 3
11 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 22700443

Adds the supplied page with the rightmost tab in the property sheet.      
  void AddPage(
   CPropertyPage *pPage
);
 Parameters pPage  
Points to the page to be added to the property sheet. Cannot be  NULL. Remarks  
Add pages to the property sheet in the left-to-right order you want them to  appear.
AddPage adds the CPropertyPage object to the  CPropertySheet object's list of pages but does not actually create the  window for the page. The framework postpones creation of the window for the page  until the user selects that page.
When you add a property page using AddPage, the CPropertySheet  is the parent of the CPropertyPage. To gain access to the property sheet  from the property page, call CWnd::GetParent.  
It is not necessary to wait until creation of the property sheet window to  call AddPage. Typically, you will call AddPage before calling DoModal or Create.
If you call AddPage after displaying the property page, the tab row  will reflect the newly added page.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 22700447
AddPage is a member function of the CPropertySheet class.



// Add two pages to a CPropertySheet object, then show the
// CPropertySheet object as a modal dialog.  Both CStylePage
// and CColorPage are CPropertyPage-derived classes created
// by the Add Class wizard.  

CPropertySheet dlgPropertySheet("Simple PropertySheet");

CStylePage     stylePage;
CColorPage     colorPage;
dlgPropertySheet.AddPage(&stylePage);
dlgPropertySheet.AddPage(&colorPage);

dlgPropertySheet.DoModal();
0
 

Author Comment

by:palhade
ID: 22700499
Can you please give me link like codeproject to some ready project as i am not able to understand much from this.
there is structure for proertysheet and structure for property page. and need to fill both.
 
One member of structure for property page is pfnDlgProc. where i need to specify method .
 
Here i am facing problem.
0
Independent Software Vendors: 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!

 

Author Comment

by:palhade
ID: 22700743
S
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 22700809
Be patient - I have only just seen your comment about the problem after my initial comments.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 22700816
Do you want a solution using MFC (which has ready made classes to help you) or C/C++ (code your own) or even .NET ?
0
 

Author Comment

by:palhade
ID: 22701117
i am not using MFC. I am using Win32
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 22701548
I don't have any code here that is of use to you.
I am not going to search the internet for you.
0
 
LVL 49

Accepted Solution

by:
DanRollins earned 500 total points
ID: 22854094
The Microsoft documentation pretty much tells you everything you need to know:
    About Property Sheets
    http://msdn.microsoft.com/en-us/library/bb774538(VS.85).aspx
However, I can tell you that using MFC objects and functions will make it a lot easier, and I suggest that you go that way if at all possible,
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

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