Henrique,
Since the name of this group is
microsoft.public.dotnet.languages.csharp, I assumed you were coding in
C#. Now I see you are actually writing managed C++ code.
I believe the MC++ syntax would be
int mult( int handle, Double x[], Double y[], int sign );
or
int mult( int handle, double x __gc[], Double y __gc[], int sign );
But you may want to post your question in
microsoft.public.dotnet.languages.vc instead to get a definite answer.
I'm looking into
[DllImport("libbmc")]
extern "C" int mult( int handle, System::IntPtr x, System::IntPtr y, int
sign );
GCHandle xh = GCHandle::Alloc( x, GCHandleType::Pinned );
IntPtr xptr = Marshal::UnsafeAddrOfPinnedArrayElement( x, 0 );
(same for yh)
int result = mult( handle, xptr, yptr, sign );
xh.Free();
yh.Free();
Pinning can be easier than that C++. You should also be able to do
extern "C" int mult( int handle, double *x, double *y, int sign );
and then
Double __pin *xp = &x[0];
Double __pin *yp = &y[0];
int result = mult( handle, xp, yp, sign );
Mattias
--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ |
http://www.dotnetinterop.com
Please reply only to the newsgroup.