Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'How come nb = NotebookCreate[] returns "$Failed"?' topicStudent Support Forum > General > "How come nb = NotebookCreate[] returns "$Failed"?"

Next Comment >Help | Reply To Topic
Author Comment/Response
Gravitas
09/26/12 11:35am

Hi,

If I open a notebook in Mathematica, and type "nb=NotebookCreate[]", it creates a new notebook, like we would expect.

However, if I try the same command from within C#, it fails:

IKernelLink ml = MathLinkFactory.CreateKernelLink();
ml.WaitAndDiscardAnswer();
string cmd2 = @"nb = NotebookCreate[]";
string result = ml.EvaluateToOutputForm(cmd2, 0);

// result is now "$Failed".

Note that if I pass in "2+2", it returns "4", which proves the link to the Mathematica kernel is working perfectly well.

URL: ,

Subject (listing for 'How come nb = NotebookCreate[] returns "$Failed"?')
Author Date Posted
How come nb = NotebookCreate[] returns "$Failed"? Gravitas 09/26/12 11:35am
Re: How come nb = NotebookCreate[] returns yehdua 10/01/12 11:26am
Next Comment >Help | Reply To Topic