User Tools

Site Tools


exposing_com_components_to_clarion_.htm
Navigation:  Clarion.Net (Clarion#) > Clarion# Language Extensions > Clarion# and COM >====== Exposing COM components to Clarion# ====== Previous pageReturn to chapter overviewNext page

In the world of COM objects, components have their interfaces defined in type libraries, rather than as metadata in the assemblies of the .NET framework. The Microsoft .NET Framework SDK contains special tools for importing these ' tlbimp. The tlbimp tool takes a type library and creates a managed code assembly that contains the necessary stubs.

COM types defined in the assembly are like any other managed type. Managed clients implemented in Clarion# 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 behave as if the object were subject to garbage collection, just as they would for any other managed server object.

exposing_com_components_to_clarion_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1