Solved

Change Focus in a PropertySheet.

Posted on 1998-11-15
9
191 Views
Last Modified: 2013-11-20
I´ve made a CDialog based app where I have a PropertySheet om the main dialog. I have made 2 sheets and when I want to check the variables on both pages I run in to trouble. I can check the top sheet by calling.
No1.UpdateData(TRUE);
But if I do the same on No2 the prog crashes. How do I change the focus on the sheets so I also can use UpdateData on the 2:d sheet.
Thanx....
0
Comment
Question by:Ffaze
[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
  • 6
  • 3
9 Comments
 

Author Comment

by:Ffaze
ID: 1324723
Adjusted points to 100
0
 

Author Comment

by:Ffaze
ID: 1324724
Edited text of question
0
 
LVL 1

Expert Comment

by:atari
ID: 1324725
Where is the problem, if you call UpdateData() from your sheet, then you can Update all CPropertyPages:

Define two variables in your sheet.h-file:

CPropertyPage m_Page1;
CPropertyPage m_Page2;

and then in your sheet.cpp-file you can call:
m_Page1.UpdateData(TRUE);
m_Page2.UpdateData(FALSE);

and so on.

If you want to update page2 from page1 then it is a little bit complicated:

CPropertySheet *PointerAufPropertySheet=(CPropertySheet *)GetParent();
((CYourDialog *)PointerAufPropertySheet->GetParent())->DoWhatYouWant();

with proper casting the GetParent()-function you can reach every parent-class you wish.

Hope this helps,
atari
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!

 
LVL 1

Expert Comment

by:atari
ID: 1324726
If you are still in trouble with your code then send me your small dialog as .zip-file to mkuelsh@aol.com and I try to fix your error !! Because I have done the stuff with property sheets and pages a lot.

Bye,
atari
0
 

Author Comment

by:Ffaze
ID: 1324727
This is how I show the Sheet.
      PropertySheet.AddPage(&StartMenuDlg);
      PropertySheet.AddPage(&DesktopDlg);
If I make like you said the prog crashes. Don´t I have to make m_Page1 and m_Page2 point to the right sheets. How do I do that??

0
 

Author Comment

by:Ffaze
ID: 1324728
I unlock this question for more Ideas....
0
 

Author Comment

by:Ffaze
ID: 1324729
I unlock this question for more Ideas....
If nobody else help me out atari gets the points....
But since the answer didn´t work I want a simple answer as soon as possible....
Thanx
0
 
LVL 1

Accepted Solution

by:
atari earned 100 total points
ID: 1324730
Next try:
I have too small information for solving your problem, try this:

if (m_YourSheet.GetActiveIndex()==0)
    m_Page1.UpdateData(FALSE);;
if (m_YourSheet.GetActiveIndex()==1)
    m_Page2.UpdateData(FALSE);

With calls of m_YourSheet.SetActiveIndex() you can also set one of the property pages active which you wish.

Maybe this works, I have too small information what you are exactly do !!!

Bye,
atari
0
 

Author Comment

by:Ffaze
ID: 1324731
It worked thanks for all your work.....
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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

729 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