C# + COM Interop, deterministic release

后端 未结 3 570
旧时难觅i
旧时难觅i 2020-12-30 07:20

COM objects usually have deterministic destruction: they are freed when the last reference is released.

How is this handled in C# - COM Interop? The classes don\'t

3条回答
  •  萌比男神i
    2020-12-30 08:09

    You can manipulate COM interop references using the System.Runtime.InteropServices.Marshal class. Specifically you may want to have a look at Marshal.ReleaseComObject.

提交回复
热议问题