COM コンポーネントの統合
MATLAB® で生成された COM コンポーネントをアプリケーションに統合するには、API の組み合わせを使用する必要があります。MATLAB Compiler SDK™ は API を使用して MATLAB Runtime の初期化、コンパイルされた MATLAB 関数の MATLAB Runtime への読み込み、COM コンポーネントと MATLAB Runtime の間で渡されるデータの管理を行います。コンパイラは、コンパイルされた関数のシグネチャに基づいて、いくつかの API を生成します。MATLAB Runtime はすべてのアプリケーションで一貫した他の API を提供します。
MATLAB 関数を Microsoft® Office 製品に統合するには、COM コンポーネントを使用します。MATLAB Compiler™ は、Microsoft Excel® との直接統合を提供しています。
関数
compiler.build.comComponent | Create COM component for deployment outside MATLAB |
compiler.build.COMComponentOptions | Options for building COM components |
mcrinstaller | 現在のプラットフォームに対応する MATLAB Runtime インストーラーのバージョンと場所の情報を表示 |
mcrversion | MATLAB のバージョンに対応する MATLAB Runtime のバージョン番号を返す |
COM ユーティリティ クラス
例および使用方法
- MATLAB コードを使用した汎用 COM コンポーネントの作成
汎用 COM コンポーネントを作成する方法を学習する。
- Register and Reference Utility Library
Register the
MWComUtil
library to use COM components. - Call the Methods of a Class Instance
Call class methods to access the encapsulated MATLAB functions.
- Call COM Objects in Visual C++ Programs
Integrate a COM object into a Visual C++® program.
- Pass Arguments
Pass multiple arguments as a
varargin
array by creating aVariant
array and assigning each array element to the respective input argument. - Control Array Formatting and Data Conversion
Refer to array formatting and data conversion flags.
- Use MATLAB Global Variables in Visual Basic
Class properties allow an object to retain an internal state between method calls.
- Block Execution of Applications That Create Figures
Handle interaction in a console-based program that creates MATLAB figures.
- Obtain Registry Information
Use MATLAB function
componentinfo
to query the system registry for installed COM components. - Integrate Magic Square into a COM Application
Create a COM component from a simple MATLAB file.
- Package COM Components from Command Line
Use
mcc
to build COM components. - Install COM Components
Deploy COM components on target machines.
概念
- General Techniques
Integrate COM components into COM compliant programs.
- Handle Errors During a Method Call
Learn how Microsoft Visual Basic® handles exceptions.
- Register COM Component
Register COM components created by MATLAB Compiler SDK on the target machine.
- Data Conversion
Convert data between MATLAB and COM variants.
- Calling Conventions
Learn the method calling conventions for COM components.