필터 지우기
필터 지우기

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