Skip to Main Content Skip to Search
Product Documentation

release - Release COM interface

Syntax

h.release
release(h)

Description

h.release releases the interface and all resources used by the interface. You must release the handle when you are done with the interface. A released interface is no longer valid. MATLAB generates an error if you try to use an object that represents that interface.

release(h) is an alternate syntax.

Releasing the interface does not delete the control itself (see the delete function), since other interfaces on that object might still be active.

COM functions are available on Microsoft Windows systems only.

Examples

  1. Create an instance of a Microsoft Calendar control. Get a TitleFont interface and use it to change the appearance of the calendar title font:

    f = figure('position',[300 300 500 500]);
    cal = actxcontrol('mscal.calendar', [0 0 500 500], f);
    
    TFont = cal.TitleFont;
    TFont.Name = 'Viva BoldExtraExtended';
    TFont.Bold = 0;
  2. After working with the title font, release the TitleFont interface:

    TFont.release;
    
  3. Delete the cal object and the figure window:

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

See Also

actxcontrol | actxserver | delete (COM)

How To

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


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