From GUI Bloopers, by Jeff Johnson (Morgan Kaufman Publishers, 2000). Used without permission.
What's wrong with this?
What can you do about this?
Limit the number of dialogs to two, at any one time. A dialog may call another dialog, but after that you must rethink your command design. Bear in mind that this only applies to "true" dialog boxes (error, warning, file chooser, etc.), and not other primary windows in your application.
You can consider remapping the functionality of a dialog to a submenu, for example, or a hidden panel. The simpler your dialog, the more likely it is that the functionality could be put elsewhere.