release - Release interface

Syntax

h.release
release(h)

Description

h.release releases the interface and all resources used by the interface. Each interface handle must be released when you are finished manipulating its properties and invoking its methods. Once an interface has been released, it is no longer valid. Subsequent operations on the MATLAB® object that represents that interface will result in errors.

release(h) is an alternate syntax for the same operation.

Examples

Create a Microsoft® Calender application. Then create a TitleFont interface and use it to change the appearance of the font of the calendar's title:

f = figure('position',[300 300 500 500]);
cal = actxcontrol('mscal.calendar', [0 0 500 500], f);

TFont = cal.TitleFont
TFont =
   Interface.Standard_OLE_Types.Font

TFont.Name = 'Viva BoldExtraExtended';
TFont.Bold = 0;

When you're finished working with the title font, release the TitleFont interface:

TFont.release;

Now create a GridFont interface and use it to modify the size of the calendar's date numerals:

GFont = cal.GridFont
GFont =
   Interface.Standard_OLE_Types.Font

GFont.Size = 16;

When you're done, delete the cal object and the figure window:

cal.delete;
delete(f);
clear f;

See Also

delete (COM), save (COM), load (COM), actxcontrol, actxserver

  


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