Skip to Main Content Skip to Search
Product Documentation

NET.enableAutoRelease - Package: NET

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

Syntax

A = NET.enableAutoRelease(obj)

Description

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.

Examples

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);

See Also

NET.disableAutoRelease

How To

  


» Learn more
» Download free kit
» Get trial software

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS