User`s guide
5 Controlling Code Generation
5-30
The COM wrapper options create a superset of the files created when
producing a C or C++ library wrapper. In addition to the C or C++ library files,
the COM wrapper creates the files shown in the following table.
If the
<class_name> is not specified, it defaults to <component_name>. If the
version number is not specified, it defaults to the latest version built or 1.0, if
there is no previous version.
The COM wrapper option creates all the required code and files to create a
single COM object that contains all of the compiler-generated interfaces. It
creates a single COM class with the same name as the specified
<class_name>
and a corresponding interface class called
I<class_name>. It uses the major
and minor version numbers to control the major and minor version numbers of
the COM interface that is produced.
The Compiler can generate either C or C++ code for the compiler M-files, but
the created COM interface will always require C++. This is a requirement of
COM and not particular to the MATLAB Compiler.
All of the extra files generated by the MATLAB Compiler that are required for
producing the COM objects are added to the
mbuild command line. The details
of how
mbuild processes the new file types (.def, .rc, and .idl) are specified
in “How mbuild Processes the File Types” on page 5-32.
If the major and minor version numbers are specified, the Compiler replaces
any existing type library with the specified new version number. If no version
numbers are specified and there is an existing type library, the Compiler
replaces the current version.
File Description
<component_name>_idl.idl
Interface description file for COM
<component_name>_com.hpp
C++ header file for the COM class
<component_name>_com.cpp
C++ source file for the COM class
<component_name>_dll.cpp
DLL interface for the COM object
<component_name>.def
Definition file for the COM DLL
<component_name>.rc
Resource file for the COM DLL