Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #8828

Re: Can you call 32 Bit DLLs from Mathematica 8.0 ?

From "Oleksandr Rasputinov" <oleksandr_rasputinov@ymail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Can you call 32 Bit DLLs from Mathematica 8.0 ?
Date 2012-03-02 12:48 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jiqfjm$2p$1@smc.vnet.net> (permalink)
References <jinjsa$d4v$1@smc.vnet.net>

Show all headers | View raw


On Thu, 01 Mar 2012 10:43:22 -0000, Guido <guido.reichert@gmx.de> wrote:

> I am using a System Dynamics software (Vensim DSS) that is still a 32
> Bit application and provides a full 32 Bit DLL for use with other
> programs. I had thought that I can call that DLL from Mathematica 8.0.
>
> Such a call produces a 'BadFormat' error and the Vensim support says
> that 64 Bit and 32 Bit do not mix well. Is there any chance to call a
> 32 Bit DLL from Mathematica 8.0?
>
> Kind regards
>
> Guido
>

Not from the 64-bit version, no; it is simply not possible for a 64-bit  
Windows process to load a 32-bit DLL directly. Fortunately, both 32- and  
64-bit versions of Mathematica are provided in the standard installation,  
probably for exactly this reason. To help you start the 32-bit Mathematica  
kernel on a 64-bit system, you can evaluate:

SetOptions[$FrontEnd,
   EvaluatorNames -> Append[
     EvaluatorNames /. Options[$FrontEnd],
     "Local (32-bit)" -> {
       "AutoStartOnLaunch" -> False,
       "Executable" -> FileNameJoin[{
         $InstallationDirectory, "SystemFiles",
         "Kernel", "Binaries", "Windows", "MathKernel.exe"
       }]
     }
   ]
];

which adds an entry for the 32-bit kernel in the kernel configuration  
options dialog, i.e. the one produced by evaluating:

FrontEndExecute@FrontEndToken["ModifyEvaluatorNames"]

With this set up, you just need to select the menu option Evaluation |  
Notebook's Kernel | Local (32-bit) in a new notebook (before evaluating  
anything) in order to have that notebook use the 32-bit kernel. This can  
also be accomplished programmatically by evaluating:

SetOptions[EvaluationNotebook[], Evaluator -> "Local (32-bit)"]

Saving the notebook also saves the kernel configuration, so it will still  
run on the 32-bit kernel when closed and re-opened.

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Can you call 32 Bit DLLs from Mathematica 8.0 ? Guido <guido.reichert@gmx.de> - 2012-03-01 10:43 +0000
  Re: Can you call 32 Bit DLLs from Mathematica 8.0 ? "Oleksandr Rasputinov" <oleksandr_rasputinov@ymail.com> - 2012-03-02 12:48 +0000
  Re: Can you call 32 Bit DLLs from Mathematica Todd Gayley <tgayley@wolfram.com> - 2012-03-03 11:57 +0000
  Re: Can you call 32 Bit DLLs from Mathematica 8.0 ? Guido <guido.reichert@gmx.de> - 2012-03-03 11:55 +0000

csiph-web