One additional comment (that just occurred to me) - your version will work if you don't try to display a page (begin - write - end) before starting the event loop in KApplication. That's probably what's causing the crash. Jim