BlueBeetle

Hi,

I'm trying to wrap a native function with the following parameter:

nfunction(long Ustart[][2])

The corresponding wrapper function has the following signature:

wfunction(array<long, 2> ustart)
{
// use pin_ptr to "convert" the manage array to native array
// call nfunction() with the "native array"
}

I know how to use pin_ptr<> for single dimensional arrays but how do I use it in this case Thanks for any help!


Re: Visual C++ Language Syntax to use pin_ptr on a multi-dimensional array?

BlueBeetle

Right now I have gotten this to compile...

wfunction(array<long, 2> ustart)
{
// use pin_ptr to "convert" the manage array to native array
cli:Stick out tonguein_ptr<long> ppUstart = &ustart[0,0];
long *nativeUstart = ppUstart;

// call nfunction() with the "native array"

}

Is the above correct I'll try it out and see...





Re: Visual C++ Language Syntax to use pin_ptr on a multi-dimensional array?

BlueBeetle

Nope, the above didn't work.




Re: Visual C++ Language Syntax to use pin_ptr on a multi-dimensional array?

Holger Grund

It's correct usage, though (fixing the obvious syntax errors). What's the exact problem

-hg