Solved

Distinguishing between Back and Next in

Posted on 1997-08-28
5
155 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now