Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2001
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

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

Search the Archive

Re: calling function in a DLL from Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg26685] Re: [mg26646] calling function in a DLL from Mathematica
  • From: John Fultz <jfultz at wolfram.com>
  • Date: Wed, 17 Jan 2001 00:47:34 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

At 09:36 PM 1/13/2001, Souvik Banerjee wrote:
>Is there a way to call a function in a DLL from Mathematica.
>
>Thanks,
>
>-Souvik

This is fairly easily done with MathLink and a C compiler.  Try compiling 
the sample MathLink program "addtwo" following the instructions in the 
online help for the MathLink Developer's Kit (Add-ons->MathLink 
Library->System-Specific Information in the help browser).  Once you get 
that program successfully compiled and running, it is a fairly simple task 
to change the "addtwo" function to call a function in your DLL, and change 
the project or make file to link in the .lib file referencing that DLL.

Incidentally...I think the documentation may be a bit unclear on where the 
sources for the sample programs are.  You can find them in...

<install directory>\AddOns\MathLink\DevelopersKits\Windows\MathLinkExamples



Sincerely,

John Fultz
jfultz at wolfram.com
User Interface Group
Wolfram Research, Inc.



  • Prev by Date: Re: Calling Mathematica-4.0 from C Code.
  • Next by Date: Switching Output Format Type for a single cell
  • Previous by thread: Re: calling function in a DLL from Mathematica
  • Next by thread: Calling Mathematica-4.0 from C Code.