Quantcast

SWIG and MarshalAs in C#

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

SWIG and MarshalAs in C#

Gonzales, Jeff

Hi Everyone,

 

I notice that the default code created with SWIG doesn’t make use of MarshalAs when using C#.  Is there an advantage to not doing so?  Is there a way to generate code that does use MarshalAs?

 

Thanks,

Jeff


------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive.
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SWIG and MarshalAs in C#

William S Fulton
On 25 October 2016 at 13:54, Gonzales, Jeff <[hidden email]> wrote:
> Hi Everyone,
>
>
>
> I notice that the default code created with SWIG doesn’t make use of
> MarshalAs when using C#.  Is there an advantage to not doing so?  Is there a
> way to generate code that does use MarshalAs?


You can change the approach via typemaps. There are some typemaps in
wchar.i, std_wstring.i and arrays_csharp.i that use MarshalAs. Also if
you read the C# documentation you'll find typemaps using MarshalAs.

William

------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive.
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Loading...