.NET/Link API Version 1.7 USE FRAMES

MathLinkFactory.CreateKernelLink�Method�(String[])

Creates a link to a Mathematica kernel based on MathLink parameters supplied as an argv-type array of strings.

[Visual�Basic]
Overloads�Public�Shared�Function�CreateKernelLink( _
���ByVal argv�As�String()�_
)�As�IKernelLink
[C#]
public�static�IKernelLink�CreateKernelLink(
���string[]�argv
);

Parameters

argv
The array of MathLink arguments.

Return Value

The created link.

Remarks

Use this method if you want to specify the path to the kernel, or if you want to establish a listen/connect link instead of launching the kernel.

You can use standard MathLink specifications for establishing a link, as documented in the Mathematica book or other MathLink documentation. For example, -linkprotocol, -linkname, and -linkmode.

An example of a string array argument would be:
string[] mlArgs = {"-linkmode", "listen", "-linkname",  "foo"};
IKernelLink ml = MathLinkFactory.CreateKernelLink(mlArgs);
To avoid worries about quoting \ characters used in a pathname, use a forward slash (/) in the path:
string[] mlArgs = {"-linkmode", "launch", "-linkname", "c:/path/to/my/mathematica/mathkernel.exe"};
IKernelLink ml = MathLinkFactory.CreateKernelLink(mlArgs);

Exceptions

Exception TypeCondition
MathLinkExceptionIf the opening of the link fails.

See Also

MathLinkFactory Class | Wolfram.NETLink Namespace | MathLinkFactory.CreateKernelLink Overload List