Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

delete (COM) - Remove COM control or server

Syntax

h.delete
delete(h)

Description

h.delete releases all interfaces derived from the specified COM server or control, and then deletes the server or control itself. This is different from releasing an interface, which releases and invalidates only that interface.

delete(h) is an alternate syntax.

Remarks

COM functions are available on Microsoft Windows systems only.

Examples

Create a Microsoft Calendar 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

MATLAB software displays information similar to:

TFont =
  Interface.Microsoft_Forms_2.0_Object_Library.Font

Make the following changes and observe the results:

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

MATLAB displays:

GFont =
  Interface.Microsoft_Forms_2.0_Object_Library.Font

Make the following changes and observe the results:

GFont.Size = 16;

When you're done, delete the cal object and the figure window. Deleting the cal object also releases all interfaces to the object (for example, GFont):

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

Note that, although the object and interfaces themselves have been destroyed, the variables assigned to them still reside in the MATLAB workspace until you remove them with clear:

whos

MATLAB displays (in part):

  Name        Size                   Bytes  Class

  GFont       1x1                        0  handle
  TFont       1x1                        0  handle
  cal         1x1                        0  handle

See Also

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

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

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