User`s guide

A Producing a COM Object from MATLAB
.
.
.
[in] VARIANT varargin);
This IDL function definition is generated by producing a function with the
same name as the original M -function and an argument list containing all
inputs and outputs of the original plus one additional parameter,
nargout.
(
nargout is not produced if you compile an M-function containing no outputs.)
When present, the
nargout param eter is an [in] parameter of type long.
It is always the first argument in the list. This parameter allows correct
passage of the MATLAB
nargout param eter to the compiled M-code.
Following the
nargout parameter, the outputs are listed in the order they
appearontheleftsideoftheMATLABfunction,andaretaggedas
[in,out],
meaningthattheyarepassedinbothdirections. The function inputs are
listed next, appearing in the same order as they do on the right side o f the
origina l function. All inp uts are tagg ed as
[in] parameters. When present,
the optional
varargin/varargout param eters are always listed as t he last
input p aram eters and the last output parameters. All parameters other than
nargout are passed as COM VARIANT types. “Data Conversion Ru les” on
page B-2 lists the rules for conversion between MATLAB arrays and COM
VARIANTs.
Visual Basic Mapping
The Visual Basic mapping to the IDL signature shown in “IDL Mapping”
on page A-11 is
Sub foo(nargout As Long, _
Y1 As Variant, _
Y2 As Variant, _
.
.
.
varargout As Variant, _
X1 As Variant, _
X2 As Varaint, _
.
.
.
A-12