MathGroup Archive 2000

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

Search the Archive

Mathlink MLGetString in C++


Hi all,

I'm using Mathematica as a computational engine, creating my

own front end, as it were.I'm using MLPutString and
MLGetString as my connections to the mathkernel.  However,
the second argument of MLGetString is a const char **.  This
causes problems in C++ under the stronger type checking. I'm
using MS visual C++ compiler ver 6 , and the ml32i2m.lib
file supplied with mathlink ver 3.7,  system is winnt ver 4
with Mathematica 4

The following code fragment

MLINK lp;
char ** ml_outout;
MLGetString(lp,ml_output);

will compile fine under a dot c extension file, but will
fail under a dot cpp extension file due to the stronger type
checking.

Things tried:
use const char ** ml_output - this compiles fine under C++
but will crash the program, as the mathkernel attempts to
change const ml_output.

use in the header file
 extern "C" {MLGetString(MLINK, char **);}
this causes a complier error of error --- C2733: second C
linkage of overloaded function 'MLGetString' not allowed

Suggestions?

Thanks in advance.

Cheers
\Andrew
Student at Dublin City University
Computer Applications (Evening) Year 4





  • Prev by Date: Re: Re: ReExitDialog in ButtonfFunction
  • Next by Date: Re: Fonts in Plots?
  • Previous by thread: degree symbol "bug"
  • Next by thread: Re: [TS 3227] ListInterpolation