tags:

views:

41

answers:

1

I am trying to handle the 'Cancel' button in my property pages (wizard) and I've implemented the 'OnQueryCancel' function to catch the cancel message successfully, but unfortunately it seems that the 'OnQueryCancel' function is being called twice if the user clicked the cancel button. Any ideas on how I could address this issue? Thanks!

virtual BOOL OnQueryCancel();

BOOL CWiz_Page1::OnQueryCancel()

{    
      int ret;  
      ret = MessageBox("Are you sure?", NULL, MB_YESNO);     
      if(ret == IDYES)   
           return true; 
      else   
           return false;

}
A: 

My first guess is that you have directly sunk the "query cancel" message (is that a message?) or maybe you have a click handler on the button itself AND it is called automatically on click of the cancel button. Try commenting out your message map entry.

Try creating a new project with classwizard and compare.

Aidan Ryan
Care to share what the specific problem was?
Aidan Ryan