External Interfaces Reference Previous page   Next Page
actxserver

Create COM Automation server

Syntax

Description

h = actxserver(progid) creates a COM server, and returns COM object, h, representing the server's default interface. progid is the programmatic identifier of the component to instantiate in the server. This string is provided by the control or server vendor and should be obtained from the vendor's documentation. For example, the progid for MATLAB is matlab.application.

h = actxserver(progid, systemname) creates a COM server running on the remote system named by the systemname argument. This can be an IP address or a DNS name. Use this syntax only in environments that support Distributed Component Object Model (DCOM).

Remarks

For components implemented in a dynamic link library (DLL), actxserver creates an in-process server. For components implemented as an executable (EXE), actxserver creates an out-of-process server. Out-of-process servers can be created either on the client system or any other system on a network that supports DCOM.

If the control implements any custom interfaces, use the interfaces function to list them, and the invoke function to get a handle to a selected interface.

There is currently no support for events generated from automation servers.

Examples

Create a COM server running Microsoft Excel and make the main frame window visible:

Call the get method on the excel object to list all properties of the application:

Create an interface:

List all methods for that interface by calling invoke with just the handle argument:

Invoke the Add method on workbooks to add a new workbook, also creating a new interface:

Quit the application and delete the object:

See Also

actxcontrol, release, delete, save, load, interfaces


Previous page  actxcontrolselect addproperty Next page

© 1994-2005 The MathWorks, Inc.