zoukankan      html  css  js  c++  java
  • Exposing COM Components to the .NET Framework之二Create COM types in managed Code.

    Using COM Types in Managed Code

    COM types defined in an assembly are like any other managed type. Managed clients can create a new instance of a COM type in the usual way and obtain class information through metadata as they would for any other managed class. Method syntax can be inspected through an object viewer or obtained using reflection, just as it can with any other managed class. When the COM object returns a failure HRESULT, the .NET client catches a corresponding exception.

    Obtaining and releasing a reference to a running COM object is just like obtaining and releasing a reference to any other running managed object. When .NET clients obtain and release a reference to a COM object, the runtime maintains the reference count on the COM object just as any other COM client would, and .NET clients can behave as if the object were subject to garbage collection, just as they would for any other managed server object.

    For code samples that accompany the topics of this section, see COM Interop Sample: .NET Client and COM Server.

  • 相关阅读:
    Linq101-Generation
    Linq101-Element
    解决 oracle 错误ORA-01033
    Oracle数据表恢复
    C++构造函数
    C++类与对象
    CMake命令之export
    CMake命令之install
    CMake变量(提供信息的变量)
    CMake常用变量
  • 原文地址:https://www.cnblogs.com/MayGarden/p/1630967.html
Copyright © 2011-2022 走看看