How can I wrap a COM object in a native .NET class?

后端 未结 4 1069
醉梦人生
醉梦人生 2021-02-05 10:53

I\'m using an extensive existing COM API (could be Outlook, but it\'s not) in .NET (C#). I\'ve done this by adding a \"COM Reference\" in Visual Studio so all the \"magic\" is

4条回答
  •  走了就别回头了
    2021-02-05 11:29

    You are making it unnecessarily difficult. It is not a "handle", there's no need for reference counting. A __ComObject is a regular .NET class and subject to normal garbage collection rules.

提交回复
热议问题