[Mono-devel-list] Custom Marshalling

Jonathan S. Chambers Jonathan.Chambers at ansys.com
Mon Jul 18 14:22:22 EDT 2005


Thanks, I will.

-----Original Message-----
From: Zoltan Varga [mailto:vargaz at gmail.com] 
Sent: Monday, July 18, 2005 2:21 PM
To: Jonathan S. Chambers
Cc: mono-devel-list at lists.ximian.com
Subject: Re: [Mono-devel-list] Custom Marshalling

                                   Hi,

   Better yet, please file a bug report about it at bugzilla.ximian.com.

               Zoltan
  

On 7/18/05, Jonathan S. Chambers <Jonathan.Chambers at ansys.com> wrote:
>         I'm following the methods demonstrated in the book '.Net and COM' by Adam Nathan in his chapters on PInvoke and Custom Marshalling. His examples demonstrate marshalling by-ref/out parameters. Plus, (I know this means little), it does work in .Net.
>         I'll try to distill the test code to a small sample and post it.
> 
> - Jonathan
> 
> -----Original Message-----
> From: Kornél Pál [mailto:kornelpal at hotmail.com]
> Sent: Monday, July 18, 2005 2:06 PM
> To: Jonathan S. Chambers; mono-devel-list at lists.ximian.com
> Subject: Re: [Mono-devel-list] Custom Marshalling
> 
> According to my experiences by-ref (out is by-ref as well) custom marshaling
> is not supported in either runtime. Could you attach please a full test code
> (managed and umnanaged source code) to can I try it?
> 
> Kornél
> 
> ----- Original Message -----
> From: Jonathan S. Chambers
> 
> 
> Hello All,
> I am trying to use a custom marshaler in mono. The marshaling
> from managed to native is working great, but my custom marshalling code
> is not getting hit for the native to managed case. Here are my pinvoke
> signatures:
> 
> [DllImport(@"TestLib.dll", CallingConvention = CallingConvention.Cdecl)]
> public extern static int
> SetName([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef =
> typeof(StringMarshaler))]string name);
> 
> [DllImport(@"TestLib.dll", CallingConvention = CallingConvention.Cdecl)]
> public extern static int
> GetName([MarshalAs(UnmanagedType.CustomMarshaler,MarshalTypeRef=typeof(S
> tringMarshaler)), Out]out string name);
> 
> So my SetName function works fine, but when I call GetName the
> MarshalNativeToManaged method on my custom marshaller is not getting
> called (and it does in .Net). Any thoughts?
> 
> Thanks,
> Jonathan
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
> 
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>





More information about the Mono-devel-list mailing list