Solved

Distinguishing between Back and Next in

Posted on 1997-08-28
5
172 Views
Last Modified: 2013-11-20
I am using the Custom App Wizard to make one of my own custom wizards.

For each step in my custom wizard, an OnDismiss handler is generated. All validation of data for this step is to be done in this function (according to the comments inserted by the AppWizard). This handler is called whenever the user hits Next, Back or Finish in the wizards.

I would like to do some validation - but only if the user hit either the Next or the Finish button.  I don't want to bother validating if the user hit the Back button.

While in this handler, I can't seem to find a  way to let me know which button(Back/Next/Finish) was pressed. Any hints?  

0
Comment
Question by:shruthi
  • 3
  • 2
5 Comments
 
LVL 4

Expert Comment

by:davmarc
ID: 1305112
Override CCustomAppWiz::Back() and set a custom flag indicating the user pressed Back.
This gives you the ability to avoid doing your validations in CCustomAppWiz::OnDismiss() when the flag is set. In any case, turn off the flag in this method.

Davide Marcato.
0
 

Author Comment

by:shruthi
ID: 1305113
I doubt that this would work.  I have looked at it and the OnDismiss handler is called before the CCustomAppWiz::Back or
CCustomAppWiz::Next routine is called.  So, there is really no use in my setting a flag in the Back or Next routines - by then,
the code would have already walked through the validation in the
OnDismiss routine.
0
 
LVL 4

Accepted Solution

by:
davmarc earned 50 total points
ID: 1305114
Oops! You are right.
A wild guess...maybe the clicked button has the focus when OnDismiss() is called?

Davide Marcato.
0
 

Author Comment

by:shruthi
ID: 1305115
Thanks Davide!  The clicked button does seem to have the focus when the OnDismiss handler is called.  I would have preferred a far-more direct interface for this functionality, but I guess I'll have to be satisfied with this!
0
 
LVL 4

Expert Comment

by:davmarc
ID: 1305116
I get your point, but a (pretty) dirty workaround is better than nothing, isn't it?

Davide Marcato.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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…
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…
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.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

809 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