Thanks guys.

The VS wizard created OnDestroy for me and the comments say to put my code after the call to CDialog::OnDestroy(). Is the window still valid at that point, or should I avoid writing anything to the text controls?