MathGroup Archive 2005

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

Search the Archive

Re: NET/Link return array from C++

  • To: mathgroup at smc.vnet.net
  • Subject: [mg60992] Re: NET/Link return array from C++
  • From: "Jens-Peer Kuska" <kuska at informatik.uni-leipzig.de>
  • Date: Fri, 7 Oct 2005 03:37:38 -0400 (EDT)
  • Organization: Uni Leipzig
  • References: <di2m5s$8d6$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

send it manual back is not an option ?

Regards
  Jens

"Lars Schouw" <schouwla at yahoo.com> schrieb im 
Newsbeitrag news:di2m5s$8d6$1 at smc.vnet.net...
|I am having some problems returning an array back 
from C++.
|
| I would expect {100.,100.,100} coming back in my 
example.
| Can anyone explain what I do wrong?
|
| C++
| void Test123(double x[], int size, double* 
result)
| {
|      for (long i = 0 ; i < size; i ++)
| *(result+i) = 100.;
| }
|
| NoteBook
|
| In[1]:= Needs["NETLink`"];
| TEST123 = 
DefineDLLFunction["ErrorFunctionA","mydll.dll",
| "Void",{"double[]", "long", "out double"}];
|
| input1=MakeNETObject[{1., 2., 3.}];
| res=MakeNETObject[{0.0,0.0, 0.0}];
|
| TEST123[input1, 3, res]
|
| NETObjectToExpression[res]
|
| 100
|
| Regards
| Lars Schouw
| 



  • Prev by Date: Globally limiting precision or accuracy
  • Next by Date: Re: Problem with D and Abs
  • Previous by thread: NET/Link return array from C++
  • Next by thread: Re: NET/Link return array from C++