Solved

Distinguishing between Back and Next in

Posted on 1997-08-28
5
142 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
I get your point, but a (pretty) dirty workaround is better than nothing, isn't it?

Davide Marcato.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

772 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

11 Experts available now in Live!

Get 1:1 Help Now