主要内容

COM Objects inMATLAB

Access COM components from MATLAB®

微软®Component Object Model(COM)提供用于将可重用的二进制软件组件集成到应用程序中的框架。由于组件由编译代码实现,所以源代码可以用支持COM的编程语言编写。金宝app简化了升级到应用程序,因为只需重新编译整个应用程序就可以简单地交换组件。此外,组件的位置对应用程序是透明的,因此可以将组件重新定位到单独的过程甚至远程系统,而无需修改应用程序。

Alternatively, consider using the Microsoft .NET Framework.

MATLAB supports COM and the .NET Framework integration on the Microsoft Windows®platform only.

Functions

actxserver Create COM server
actxGetRunningServer Handle to running instance of Automation server
methodsview 查看类方法
eventlisteners List event handler functions associated with COM object events
registerevent 将事件处理程序for COM object event at run time
unregisterallevents Unregister all event handlers associated with COM object events
未注册 Unregister event handler associated with COM object event at run time
ISCOM Determine whether input is COM object
isevent. Determine whether input is COM object event
InterInterface. 确定输入是否为COM接口

Objects

COM Access COM components fromMATLAB

例子和如何

MicrosoftOffice

Write Data to Excel Spreadsheet

This example shows how to write a MATLAB matrix to an Excel®spreadsheet.

使用Excel读取电子表格数据作为自动化服务器

This example shows how to use a COM Automation server to access another application from MATLAB.

Change Cursor in Spreadsheet

This example shows how to change the cursor icon in an Excel® spreadsheet.

在电子表格单元格范围内更改行高度

This example shows how to change the height of a row, defined by a范围对象,在电子表格中。

第一张纸后插入电子表格

此示例显示如何在Excel中跳过可选的输入参数Add方法,用于将纸张插入工作簿中。

Connect to Existing Excel Application

This example shows how to read data from an open file,weekly_log.xlsx,在matlab。

Display Message for Workbook OnClose Event

This example shows how to handle a COM interface event, how to set up an event in a微软Excel.workbook对象,以及如何处理它BeforeClose事件。

Explore COM Objects

使用MATLAB命令了解COM对象

Concepts

MATLAB COM Integration

COM concepts and an overview of COM support in MATLAB.

开始使用com

Examples that show how to use COM interface with MATLAB.

Register Servers

Before using COM objects, you must register their servers.

Create COM Objects

How to create Microsoft controls and COM server objects

Handle COM Data in MATLAB

将数据传递给并处理来自COM对象的数据

COM对象属性

List property names and set values, work with multiple objects and properties, use the Property Inspector, use enumerated values and custom properties

COM Methods

你执行,或invoke, COM functions or methods belonging to COM objects.

COM Events

Respond to events, write event handlers

COM Event Handlers

Useregisterevent注册服务器的事件。

Save and Delete COM Objects

Use these MATLAB functions to save and restore the state of a COM control object.

COM Object Interfaces

使用com interfaces

COM Collections

COMcollectionsare a way to support groups of related COM objects that can be iterated over.

金宝app支持的客户/服务器配置

COM client-server configurations in MATLAB.

MATLAB Application as DCOM Client

Distributed Component Object Model (DCOM) is a protocol that allows clients to use remote COM objects over a network.

Troubleshooting

MATLAB COM支金宝app持限制

Microsoft does not support loading 32-bit DLLs or in-process COM servers into a 64-bit application, or conversely.

在COM错误消息中解释参数标注

When a MATLAB client sends a command with an invalid argument to a COM server application, the server sends back an error message in the following format.