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
Solved

Want to add Property Page at runtime to Property Sheet

Posted on 2008-10-12
11
570 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
  • 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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
canBalance challenge 34 98
Sed question 2 102
Using Diagnostic tools in VS2015: Unresoved allocations 19 106
gdb doesn't stop on breakpoint 2 95
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

829 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