IMxDocument is not the same as IApplication, they are in two different co-classes. The document is derived from the application so you can't cast a document as application but you can cast the parent of the document as application because the parent of a document is the application. Hopefully that explanation helps.
サインインすると、投稿したり、更新をフォローしたりできます。初めての方ですか?無料アカウントを登録しましょう。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.