ntswrap

Generates type-safe API

Syntax

ntswrap.exe [-c namespace.class] [-i interface_name] [-a assembly_name]

Description

Available as a MATLAB® function or Windows console executable.

ntswrap.exe [-c namespace.class] [-i interface_name] [-a assembly_name] accepts command line switches in any order.

Run ntswrap for Generate the Type-Safe API with an Assembly with a MATLAB Compiler SDK™ generated assembly.

Arguments

Inputs

-a .NET_native_interface.dll

Absolute or relative path to assembly containing .NET statically-typed interface, referenced by -i switch.

-b MATLAB_NET_assembly.dll

Path to folder containing .NET assembly that defines component referenced by -c switch

-c component_class_name

Namespace-qualified name of assembly identified by path in -b switch

-d

Enables debugging of the type-safe API assembly

Incompatible with -s.

-i interface_name

Namespace-qualified name of user-supplied interface in assembly identified by path in -a switch

-k

Keep generated type safe API source code; do not delete after processing

-n namespace_containing_generated_type-safe_API_class

Optional. If specified, places generated type-safe API in specifed namespace

-o output_folder

Optional. If specified, all output files will be written to specified, preallocated folder

-s

Generate source code only; do not compile type-safe API source into an assembly

-v vx.x

Version of Microsoft® .NET Framework (csc compiler) used to generate type-safe API assembly (for example v4.0)

Incompatible with -s.

-w name_of_generated_type-safe_API_wrapper_class_and_assembly

Optional. If specified, overrides default name of generated type-safe API class and assembly

Incompatible with -c.

Outputs

ComponentInterface.dll

.NET binary containing type-safe API class. Requires ComponentNative.dll,Interface.dll and MWArray.dll

ComponentInterface.cs

Optional output, produced by -s and -k

Examples

ntswrap.exe -c AddOneComp.Mechanism 
            -i IAddOne 
            -a IAddOne.dll 

Issuing this command generates a type-safe API for the MATLAB Compiler SDK class Mechanism in the namespace AddOneCompNative. By default, ntswrap compiles the source code into an assembly MechanismIAddOne.dll.

If ntswrap is called as a MATLAB function, all the input arguments should be specified as character arrays or string type. For example,

ntswrap('-c', 'AddOneComp.Mechanism', ...
        '-a', 'IAddOne.dll', ...
        '-i', 'IAddOne');

Introduced in R2011a

Was this topic helpful?