This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Package: NET

Unlock .NET object representing a RunTime Callable Wrapper (COM Wrapper) so that MATLAB releases COM object


A = NET.enableAutoRelease(obj)


A = NET.enableAutoRelease(obj) releases the COM wrapper when the object goes out of scope, where obj is a .NET object representing a COM Wrapper.

Call this function only if the object was locked using NET.disableAutoRelease.


The following pseudo-code shows how to call a function (GetComApp.m, described in NET.disableAutoRelease) which returns a COM object. The object, mainObj of type NetDocTest.MyClass, has a property, MyApp. Call GetComApp to get a COM object, and use its readData method.

mainObj = NetDocTest.MyClass;
app = mainObj.MyApp;
% Unlock the COM object

Introduced in R2010b