Re: Help needed regarding function MLOpenString
- To: mathgroup at smc.vnet.net
- Subject: [mg33333] Re: [mg33324] Help needed regarding function MLOpenString
- From: John Fultz <jfultz at wolfram.com>
- Date: Sat, 16 Mar 2002 01:40:11 -0500 (EST)
- References: <200203150051.TAA15028@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
There's some ambiguity in the call to MLOpenString. You're passing... -linkname 'c:\\program files\\wolfram research\\mathematica\\3.0\\mathkernel' -mathlink This doesn't clearly indicate that the kernel should be passed the -mathlink argument (-mathlink might very well be parsed as another argument from the string instead of part of the linkname argument). If you put it inside the quotes, it becomes less ambiguous, in that sense, but more in another...which spaces are spaces in the filename and which are spaces delimit the command-line arguments to the program. A precise way to address the issue is to use MLOpenArgv(). Here's an example of how you would use it... MLEnvironment ep = MLInitialize( (MLParametersPointer)0); MLINK lp; char * argv[4]; long errorCode; argv[0] = "-linklaunch"; argv[1] = "-linkname" argv[2] = "\"C:\\Program Files\\Wolfram Research\\Mathematica\\4.1\\MathKernel\" -mathlink" argv[3] = ""; lp = MLOpenArgv(ep, argv, argv + 3, &errorCode); Sincerely, John Fultz jfultz at wolfram.com User Interface Group Wolfram Research, Inc. On Thu, 14 Mar 2002 19:51:27 -0500 (EST), akash gupta wrote: >Hi: > >We have this application which uses MathLink. It runs >perfectly fine with version 4.0 but hangs with the >version 4.1. > >The function that hangs is MLOPenString() > >Can you please help me with this. I went through the >online documentation but it seems there is no change >in this function in the two versions. Therefore cannot >figure out why one works and the other not. > >Thanks, >Akash Gupta > >The code is something like this >/*******************************************/ >ep = MLInitialize( (MLParametersPointer)0); >if( ep == (MLENV)0) return(OpenMathLinkError); >atexit( deinit); >GetPrivateProfileString("Mathematica","InitString", >"-linkname 'c:\\program files\\wolfram >research\\mathematica\\3.0\\mathkernel' -mathlink", >InitString, 254, "QRAS.INI"); >lp=MLOpenString(ep,InitString,&err); >/*******************************************/ > >Two values of InitString are >For 4.0 >InitString=-linkname 'c:\Program Files\Wolfram >Research\Mathematica\4.1\Mathkernel.exe' -mathlink > >For 4.1 >InitString=-linkname 'c:\Program Files\Wolfram >Research\Mathematica\4.0\Mathkernel.exe' -mathlink
- References:
- Help needed regarding function MLOpenString
- From: akash gupta <aks_gupta@yahoo.com>
- Help needed regarding function MLOpenString