• <bdo id='0U5fV'></bdo><ul id='0U5fV'></ul>

    <small id='0U5fV'></small><noframes id='0U5fV'>

        <tfoot id='0U5fV'></tfoot>

      1. <legend id='0U5fV'><style id='0U5fV'><dir id='0U5fV'><q id='0U5fV'></q></dir></style></legend>

        <i id='0U5fV'><tr id='0U5fV'><dt id='0U5fV'><q id='0U5fV'><span id='0U5fV'><b id='0U5fV'><form id='0U5fV'><ins id='0U5fV'></ins><ul id='0U5fV'></ul><sub id='0U5fV'></sub></form><legend id='0U5fV'></legend><bdo id='0U5fV'><pre id='0U5fV'><center id='0U5fV'></center></pre></bdo></b><th id='0U5fV'></th></span></q></dt></tr></i><div id='0U5fV'><tfoot id='0U5fV'></tfoot><dl id='0U5fV'><fieldset id='0U5fV'></fieldset></dl></div>

        C# + COM 互操作,确定性发布

        C# + COM Interop, deterministic release(C# + COM 互操作,确定性发布)

        <small id='uNZTI'></small><noframes id='uNZTI'>

        <i id='uNZTI'><tr id='uNZTI'><dt id='uNZTI'><q id='uNZTI'><span id='uNZTI'><b id='uNZTI'><form id='uNZTI'><ins id='uNZTI'></ins><ul id='uNZTI'></ul><sub id='uNZTI'></sub></form><legend id='uNZTI'></legend><bdo id='uNZTI'><pre id='uNZTI'><center id='uNZTI'></center></pre></bdo></b><th id='uNZTI'></th></span></q></dt></tr></i><div id='uNZTI'><tfoot id='uNZTI'></tfoot><dl id='uNZTI'><fieldset id='uNZTI'></fieldset></dl></div>

          <bdo id='uNZTI'></bdo><ul id='uNZTI'></ul>
        • <tfoot id='uNZTI'></tfoot>

                <tbody id='uNZTI'></tbody>

            • <legend id='uNZTI'><style id='uNZTI'><dir id='uNZTI'><q id='uNZTI'></q></dir></style></legend>

                  本文介绍了C# + COM 互操作,确定性发布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  COM 对象通常具有确定性破坏:它们在最后一个引用被释放时被释放.

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

                  在 C# - COM 互操作中如何处理?这些类没有实现 IDisposable,所以我看不到触发显式 IUnknown::Release 的方法.

                  How is this handled in C# - COM Interop? The classes don't implement IDisposable, so I see no way to trigger an explicit IUnknown::Release.

                  一个偶然的测试表明,未引用的 COM 对象被延迟收集(即垃圾收集器正在触发释放).对于需要积极释放的 OCM 对象,我该怎么办?(例如,持有大量或共享的关键资源)?

                  A casual test shows that unreferenced COM objects get collected lazily (i.e. the garbage collector is triggering the release). What should I do for OCM objects that need to be released aggresively? (e.g. holding large or shared critical ressources)?

                  原始问题:我们有一个 C# 应用程序大量使用 COM 库,并且它正在疯狂地泄漏.似乎问题在于 C++ 和 C# 代码之间"(我们可以访问两者),但我们无法确定.

                  Original problem: We have a C# application heavily using a COM library, and it is leaking like mad. It seems that the problems is "between" the C++ and the C# code (we have access to both), but we can't nail it down.

                  推荐答案

                  您可以使用 System.Runtime.InteropServices.Marshal 类来操作 COM 互操作引用.具体来说,您可能想看看 Marshal.释放ComObject.

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

                  这篇关于C# + COM 互操作,确定性发布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Performance overhead of using attributes in .NET(在 .NET 中使用属性的性能开销)
                  Accessing attribute info from DTE(从 DTE 访问属性信息)
                  c# Hide a property in datagridview with datasource(c#使用数据源隐藏datagridview中的属性)
                  Extract Display name and description Attribute from within a HTML helper(从 HTML 帮助器中提取显示名称和描述属性)
                  C# Attributes and their uses(C# 属性及其用途)
                  C# - Getting all enums value by attribute(C# - 按属性获取所有枚举值)

                  <small id='W2mNY'></small><noframes id='W2mNY'>

                    <tbody id='W2mNY'></tbody>

                  1. <legend id='W2mNY'><style id='W2mNY'><dir id='W2mNY'><q id='W2mNY'></q></dir></style></legend><tfoot id='W2mNY'></tfoot>

                    <i id='W2mNY'><tr id='W2mNY'><dt id='W2mNY'><q id='W2mNY'><span id='W2mNY'><b id='W2mNY'><form id='W2mNY'><ins id='W2mNY'></ins><ul id='W2mNY'></ul><sub id='W2mNY'></sub></form><legend id='W2mNY'></legend><bdo id='W2mNY'><pre id='W2mNY'><center id='W2mNY'></center></pre></bdo></b><th id='W2mNY'></th></span></q></dt></tr></i><div id='W2mNY'><tfoot id='W2mNY'></tfoot><dl id='W2mNY'><fieldset id='W2mNY'></fieldset></dl></div>

                        • <bdo id='W2mNY'></bdo><ul id='W2mNY'></ul>