[Mono-devel-list] Problems calling unmanaged code

Ewen Cheslack-Postava echeslack at gmail.com
Sun Aug 1 14:32:58 EDT 2004


Thanks, that worked perfectly.  Just for my understanding: Is there a
reason that you can't just pass the pointer?  It is unsafe code and
the address is fixed, so I thought that would work.  If it requires
deep understanding of how marshalling works, don't bother though b/c I
only sort of understand it.

Ewen Cheslack-Postava

On Sun, 01 Aug 2004 13:41:04 -0400, Ben Maurer <bmaurer at ximian.com> wrote:
> On Sun, 2004-08-01 at 12:48, Ewen Cheslack-Postava wrote:
> >               [DllImport ("libgphoto2.so")]
> >               internal static extern int gp_abilities_list_get_abilities
> > (_CameraAbilitiesList *list, int index, _CameraAbilities *abilities);
> Hello,
> You need to pass the struct as `out _CameraAbilities abilities'. You
> need the byref to get the marshaling you need, IIRC. CSC is actually not
> able to compile your code. I am going to file a bug on that in a minute.
> -- Ben

More information about the Mono-devel-list mailing list