Re: Interop technic withan array of Point ???



Inline...

"azerty" <azerty@xxxxxxx> wrote in message
news:%23xNNa1L9FHA.1140@xxxxxxxxxxxxxxxxxxxxxxx
> thanks ! chris
>
> I will try this technic as soon as possible !!
>
> anothers questions :
>
> * do you think it is possible to reverse the process :
>
> I want create an array of POINT in C DLL and get the reference in C#
> assembly ??
>

Yes, but it's more dangerous. You have to make sure you keep track of who
owns the pointer and who needs to free it.

> NB : the real target is to optimize the read/write set of Point[] in file
> on
> pocket PC .... and C DLL must be very faster than C# DLL (may be 10 times
> or
> more !)

Just the speed of file writing. no manipulation? I doubt you'll see much
speed difference at all, but it's worth testing.

>
> * Why do you say "not sure if you're using CF 1.0 or 2.0, so the method
> will
> be different" ??

In CF 2.0 I'd use Marshal.AllocHGlobal. In CF 1.0 I'd P/Invoke LocalAlloc.

-Chris


.