Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Want to add Property Page at runtime to Property Sheet

Posted on 2008-10-12
11
Medium Priority
?
583 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
Industry Leaders: 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 2000 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

Industry Leaders: 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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.

704 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