[Mono-list] gtk-sharp problem
Dietmar Maurer
dietmar@ximian.com
22 Jul 2002 16:26:03 +0200
On Mon, 2002-07-22 at 16:46, Mike Kestner wrote:
> On Mon, 2002-07-22 at 00:54, Dietmar Maurer wrote:
>
> > > With value types, do we need to specify the parameter as ref
> > > Gdk.EventAny in the PInvoke declaration, perhaps?
> >
> > sure, if it passes a pointer you have to use GdkEventAny*.
>
> Just to be clear, you mean "ref Gdk.EventAny" right? It's not legal to
> use "*" in method declarations, AFAICT.
Ok, "ref Gdk.EventAny" is better.
> And if we need to use the ref
> keyword, how do I deal with the function:
>
> MyValueType Foo ();
>
> If the native function is really returning a MyValueType pointer, I
> can't use the ref keyword on a return value to indicate that.
Well, thats a problem. Maybe the easiest way to wrap such functions is
to use IntPtr and then call PtrToStructure.
- Dietmar