Solved

Want to add Property Page at runtime to Property Sheet

Posted on 2008-10-12
11
569 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Line meaning 9 85
How to convert MFC APP to Win32 APP. 19 79
Issues with C++ Class 19 92
Embarcadero C++ builder XE10.1 Berlin TRegistry declaration 1 27
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 …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

776 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