External Interfaces/API | ![]() ![]() |
MATLAB ActiveX Client Support
In order to use an ActiveX component with MATLAB or with any ActiveX client, you first need to consult the documentation for that object and find out the name of the object itself (known as the ProgID), as well as the names of the interfaces, methods, properties, and events that the object uses. Once you have this information, you can integrate that object with MATLAB by using the ActiveX client support.
You create an ActiveX control or server in MATLAB by creating an instance of the MATLAB activex class. Each instance represents one interface to the object.
Note This book uses ActiveX to refer to the generic ActiveX control/server and activex to refer to the MATLAB class/object. |
Creating ActiveX Objects
There are two commands used to create activex objects initially
actxcontrol |
Creates an ActiveX control |
actxserver |
Creates an ActiveX automation server |
Manipulating the Interface
Once you create an activex object that represents an interface, you can manipulate it by invoking methods on the object to perform various actions. These methods are implemented for the activex class.
Method |
Description |
delete |
Deletes an activex object |
get |
Gets a property value from an interface or displays a list of properties |
invoke |
Invokes a method on an interface or displays a list of methods |
load |
Initializes an ActiveX object from a file |
move |
Moves and/or resizes an ActiveX control in its parent window |
propedit |
Asks the control to display its built-in property page |
release |
Releases an activex object |
save |
Serializes an ActiveX control object to a file |
send |
Displays a list of events |
set |
Sets a property on an interface |
The creation commands, actxcontrol
and actxserver
, both return a MATLAB activex object, which represents the default interface for the object that was created. However, these objects may have other interfaces. It is possible (and common) for interfaces to also be obtained by invoking a method on, or getting a property from, an existing interface. The ActiveX get
and invoke
methods automatically create and return new activex objects to represent these additional interfaces.
When each interface is no longer needed, use the release
method to release the interface. When the entire control or server is no longer needed, use the delete
command to delete it. See the section, Releasing Interfaces, for more details.
![]() | MATLAB ActiveX Support Overview | ActiveX Client Reference | ![]() |