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.