フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How can I find a .NET object if I've lost the handle?

1 回表示 (過去 30 日間)
Michael
Michael 2013 年 5 月 15 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
wordApp = Microsoft.Office.Interop.Word.ApplicationClass;
This line creates an instance of Microsoft Word, as can be observed by looking at the Windows Task Manager: the process WINWORD.EXE appears in the list. The line
wordApp.Quit()
close the application, and the WINWORD.EXE process disappears.
Now suppose the first line is called within a function, but not the second, and the handle wordApp is not returned by said function. Is there any way to retrieve a valid handle to the object instance, which still remains?
  1 件のコメント
Michael
Michael 2013 年 5 月 21 日
Just in case others come across this question ... the "obvious" solution is to make wordApp a property of a custom handle object, and to do wordApp.Quit() in the destructor of the object.
I was hoping for a non-object based approach, however, so if anybody has any insight, please let me know. Like maybe a way to find an existing instance of Microsoft.Office.Interop.Word.ApplicationClass.

回答 (0 件)

この質問は閉じられています。

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by