MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: using Mathematica to plot in visual studio

  • To: mathgroup at smc.vnet.net
  • Subject: [mg55482] Re: [mg55466] Re: using Mathematica to plot in visual studio
  • From: Todd Gayley <tgayley at wolfram.com>
  • Date: Fri, 25 Mar 2005 05:48:22 -0500 (EST)
  • References: <d1rgvo$42m$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

At 02:42 AM 3/24/2005, Hans Michel wrote:
>Siddharth Jain
>
>The following is straight from the .NETLink API.
>
>"Launches the default Mathematica kernel and returns a link to it.
>
>[Visual Basic]Overloads Public Shared Function CreateKernelLink() As
>IKernelLink
>[C#]
>public static IKernelLink CreateKernelLink();
>Return Value
>The created link.
>
>Remarks
>Use this method if you want to launch the kernel. This is probably the most
>commonly-used method in this class.
>It looks in the Windows registry for the location of the most
>recently-installed copy of Mathematica.
>
>Exceptions..."
>
>If you have the CreateKernelLink or CreateMathLink() methods somewhere in
>your code then the problem lies in Method not finding where your latest copy
>of Mathematica is located from the Registry. If it can't be found you can
>explicitly tell it where it is. Read the .NET/Link API again.
>
>you might need to do something like this
>
>             string mlArgs = "-linkmode launch -linkname
>\"c:/path/to/my/mathematica/mathkernel.exe\"";
>             IKernelLink ml = MathLinkFactory.CreateKernelLink(mlArgs);
>
>Some once pointed out how to verify if your .NET/Link programs will find the
>correct path from just registry setting or if you have to write out the path
>yourself. It is a command you run from Mathematica if it fails the you have
>to write out the path I think Todd Gayley knows more on this.


.NET/Link includes logic to automatically determine the path to the most 
recent Mathematica kernel. This lets you call CreateKernelLink() with no 
arguments and have the kernel automatically launch. Unfortunately, older 
versions of .NET/Link had a bug that made this mechanism fail on some 
systems. You have to either put the path to the desired MathKernel.exe into 
the CreateKernelLink() call, as Hans has demonstrated, or navigate to it in 
the "Choose a MathLink program to launch" dialog.

This bug was fixed in .NET/Link 1.2, which is the version that shipped with 
Mathematica 5.1. We are in the process of updating the .NET/Link download 
page at http://www.wolfram.com/solutions.mathlink.netlink to provide this 
version. You should check there within a few days to get the update.


Todd Gayley
Wolfram Research


  • Prev by Date: Re: saving data in a new cell
  • Next by Date: Re: Why is the Arrow routine so poor?
  • Previous by thread: Re: MapAt changes its response towards different expressions
  • Next by thread: Re: using Mathematica to plot in visual studio