Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

actxserver

Create COM server

Syntax

c = actxserver(progid)
c = actxserver(progid,Name,Value)

Description

example

c = actxserver(progid) creates a local OLE Automation server, where progid is the programmatic identifier (ProgID) of an OLE-compliant COM server. Returns a handle to the default interface of the server.

c = actxserver(progid,Name,Value) creates a server using name-value pair arguments.

Examples

collapse all

Create a Microsoft® Excel® object and display the ActivePrinter property. MATLAB® displays the value for your system.

e = actxserver('Excel.Application');
get(e,'ActivePrinter')
ans = \\printers\Copy-Fl2-South on Ne04:

When you are finished with the application, close Excel in MATLAB and delete the server object.

Quit(e)
delete(e)

Input Arguments

collapse all

Programmatic identifier, specified as a character vector. The control or server vendor documentation specifies the ProgID. For MATLAB progid values, see Programmatic Identifiers.

Example: 'Matlab.Application'

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'machine','mymachine'

collapse all

Name of remote computer on which to start the server, specified as a character vector.

Interface name of the COM object, specified as a character vector. Values for interfaceName are:

  • The custom interface name — You must know the name of the interface and have the server vendor documentation. For information about custom COM servers and interfaces, see COM Server Types.

  • IUnknown — Use the IUnknown interface. MATLAB does not support the IUnknown interface with 64-bit MATLAB.

Output Arguments

collapse all

COM object, returned as a function handle.

Limitations

  • COM functions are available on Microsoft Windows® systems only.

  • 64-bit MATLAB does not support the IUnknown interface.

  • The MATLAB COM Interface does not support invoking functions with optional parameters.

Tips

  • 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 on any other system on a network that supports DCOM.

  • If the control implements custom interfaces, use the interfaces function to list them and the invoke function to access the selected interface.

  • You can register events for COM servers. For more information, see COM Events.

Introduced before R2006a

Was this topic helpful?