Hmmm.. Very strange. But it's doing what you tell it to. You click on OK and fire off another dialog before you destroy the first one.

I think this is why the MFC docs state that if you want to have a dialog appear after another closes, execute that dialog outside of the one that is closing, not inside of it.