이 페이지의 최신 내용은 아직 번역되지 않았습니다. 최신 내용은 영문으로 볼 수 있습니다.

COM 객체 호출

MATLAB®에서 COM 구성요소와 ActiveX® 컨트롤에 액세스

Microsoft® COM(Component Object Model)은 재사용 가능한 이진 소프트웨어 구성요소를 응용 프로그램에 통합할 수 있도록 하는 프레임워크를 제공합니다. 구성요소는 컴파일된 코드로 구현되므로, COM을 지원하는 프로그래밍 언어로 구성요소의 소스 코드를 작성할 수 있습니다. 컴파일할 때는 전체 응용 프로그램을 다시 컴파일할 필요 없이 구성요소를 간단히 바꾸면 되므로 응용 프로그램 업그레이드가 간편해집니다. 또한 응용 프로그램에게는 구성요소의 위치가 투명(Transparent)하기 때문에 응용 프로그램을 수정하지 않고도 구성요소를 개별 프로세스나 원격 시스템에 재배치할 수 있습니다.

또는 Microsoft .NET Framework를 사용해 보십시오.

MATLAB은 Microsoft Windows® 플랫폼에서만 COM과 .NET Framework의 통합을 지원합니다.

함수

actxserverCOM 서버 생성
actxcontrolFigure 창에 Microsoft ActiveX 컨트롤 만들기
actxcontrollist현재 설치된 Microsoft ActiveX 컨트롤 목록 표시
actxcontrolselectUI에서 Microsoft ActiveX 컨트롤 생성
eventlistenersCOM 객체 이벤트와 연결된 이벤트 핸들러(Event Handler) 함수 나열
methodsview클래스 메서드(Class Method) 보기
registereventAssociate event handler for COM object event at run time
unregisteralleventsUnregister all event handlers associated with COM object events
unregistereventUnregister event handler associated with COM object event at run time
iscom입력값이 COM 객체 또는 ActiveX 객체인지 확인
isevent입력값이 COM 객체 이벤트인지 확인
isinterface입력값이 COM 인터페이스인지 확인

객체

COMMATLAB에서 COM 구성요소와 ActiveX 컨트롤에 액세스

예제 및 방법

Microsoft Office

ActiveX를 사용하여 Excel 스프레드시트에 데이터 쓰기

이 예제에서는 Excel® 스프레드시트에 MATLAB 행렬을 작성하는 방법을 보여줍니다.

Excel을 자동화 서버로 사용하여 스프레드시트 데이터 읽기

이 예제에서는 COM 자동화 서버를 사용하여 MATLAB에서 다른 응용 프로그램에 액세스하는 방법을 보여줍니다.

Change Cursor in Spreadsheet

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

Change Row Height in Range of Spreadsheet Cells

This example shows how to change the height of a row, defined by a Range object, in a spreadsheet.

Insert Spreadsheet After First Sheet

This example shows how to skip an optional input argument in the Excel Add method, used to insert a sheet into a workbook.

Connect to Existing Excel Application

This example shows how to read data from an open file, weekly_log.xlsx, in 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 Microsoft Excel workbook object, and how to handle its BeforeClose event.

Explore COM Objects

Learn about a COM object using MATLAB commands

ActiveX 컨트롤

MATLAB Sample ActiveX Control mwsamp

MATLAB includes an example COM control that draws a circle on the screen, displays some text, and fires events when the user single- or double-clicks the control.

Redraw Circle in mwsamp Control

This example shows how to call a method of the mwsamp control to redraw a circle.

Display Event Messages from mwsamp Control

This example shows how to handle events fired by the MATLAB ActiveX control, mwsamp2.

Add Position Property to mwsamp Control

This example shows how to add a custom property, Position to the mwsamp control.

Combine Event Handlers as MATLAB Local Functions

This example shows how to consolidate event handlers into a single file using local functions.

Save mwsamp2 COM Control

This example shows how to restore original mwsamp2 control settings.

Deploy ActiveX Controls Requiring Run-Time Licenses

When you deploy a Microsoft ActiveX control that requires a run-time license, include a license key, which the control reads at run time.

개념

MATLAB COM Integration

COM concepts and an overview of COM support in MATLAB software

Getting Started with COM

Examples that show how to use COM interface with MATLAB software

Registering Controls and Servers

Before using COM objects, you must register their controls and servers.

COM 객체 만들기

Microsoft ActiveX 컨트롤과 COM 서버 객체를 만드는 방법

Handle COM Data in MATLAB

Pass data to and handle data from a COM object

COM Object Properties

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

COM Methods

You execute, or invoke, COM functions or methods belonging to COM objects.

COM Events

Respond to events, write event handlers

COM Event Handlers

For controls, register handler functions either at the time you create an instance of the control (using actxcontrol), or any time afterward (using registerevent).

Save and Delete COM Objects

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

COM Object Interfaces

Use COM interfaces

COM Collections

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

Supported Client/Server Configurations

COM client-server configurations in MATLAB software

Microsoft Forms 2.0 Controls

Microsoft Forms 2.0 controls are designed for use with applications enabled by Microsoft Visual Basic® for Applications (VBA).

MATLAB Application as DCOM Client

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

문제 해결

MATLAB COM Support Limitations

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

Interpreting Argument Callouts in COM Error Messages

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.