MathGroup Archive 2006

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

Search the Archive

Re: Please Help a student...

  • To: mathgroup at
  • Subject: [mg67422] Re: [mg67414] Please Help a student...
  • From: Sseziwa Mukasa <mukasa at>
  • Date: Fri, 23 Jun 2006 04:31:35 -0400 (EDT)
  • References: <>
  • Sender: owner-wri-mathgroup at

On Jun 22, 2006, at 6:21 AM, Kerekes Csaba - Antal wrote:

>   I'm a student in Romania, I study informatics. I use Mathematica
> and I'm very satisfied with the product. I use it because I work in
>  the number field theory and experimental mathematics, where I need  
> big number precision. I am now in my last year and I need to show  
> my final project.
>    I have been written an algorithm in Mathematica, and  I need to  
> make a graphical user interface in MS Visual C++ 6.0. I have make  
> the first step successfully I connected MS VC++6.0 with Mathematica  
> via MathLink and I can call every function from Mathematica  
> directly from my VC++ program.
>    Here comes my question:
>    I sad I can call every Mathematica function from VC++ via  
> MathLink but what can I do to call my own written Mathematica  
> function from VC++6.0?
>    Please Help I got my finals in one week, and by the university  
> nobody can help me. I need to do my GUI in VC++ and I have not yet  
> connected my own function written in Mathematica.
>    Please send be a good description in a short time: how to call  
> in MS VC++6.0 via MathLink your own function written in  
> Mathematica, or youre notebook file.

I don't have any code that does this, but this is how I understand  
one would go about this.  First of all to simplify the task, tag all  
the cells of your notebook that contain expressions you wish to  
evaluate with something unique then:

- From your Mathlink program issue a NotebookOpen 
["YourNotebookFileName",Visible->False] this will return a  

- Issue a SetSelectedNotebook[NotebookObject] where NotebookObject is  
the result of the previous expression.

- Issue a NotebookLocate[YourTag] this sets the selection to be all  
the cells of interest.  If you did not tag the cells you will have to  
select each cell of the notebook in turn, examine its contents and  
evaluate it if necessary, the commands to do this are described in  
the Built-in Functions->Notebooks->Notebook Operators and Built-in  
Functions->Notebooks->Notebook Manipulations sections of the Help  

- Issue a SelectionEvaluateCreateCell[NotebookObject] where the  
NotebookObject is the result of the first command.

You should now be able to issue commands for the expressions defined  
in your notebook as with any other Mathematica expression.  You can  
issue a NotebookClose when you're done.

Hope this helps,


  • Prev by Date: Points sampled by NIntegrate
  • Next by Date: Re: Uniform arc length basis curve fitting
  • Previous by thread: Please Help a student...
  • Next by thread: Re: Please Help a student...