Main Content

NET.enableAutoRelease

Unlock .NET object representing RunTime Callable Wrapper (COM wrapper)

Description

example

NET.enableAutoRelease(obj) releases the COM wrapper when the object goes out of scope.

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

Examples

collapse all

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;
GetComApp(mainObj);
app = mainObj.MyApp;
app.readData('hello');
% Unlock the COM object
NET.enableAutoRelease(mainObj.MyApp);

Input Arguments

collapse all

.NET object representing a COM wrapper, specified as a COM wrapper class object.

Example: ComNamespace.ComClass

Introduced in R2010b