i dont think that the error is caused by your return code, you need to step into the code on the cancel button handler and try to "isolate" the line that causes the exception, watch variables and go line by line till you find out whats wrong. If you still cant find whats wrong, post the code for your CMainWizard class so we can help you find the problem. HTH