[MonoDevelop] communicating a C++ library and C#, completed

Sharique uddin Ahmed Farooqui safknw at gmail.com
Tue Jan 17 17:16:28 UTC 2012


Sharique uddin Ahmed Farooqui
http://safknw.blogspot.com/
"Peace" is the Ultimate desire of mankind.



On Tue, Dec 13, 2011 at 8:22 AM, Leonel Florin Selles
<leonel.florin at cfg.jovenclub.cu> wrote:
> Hi list, in a few day ago I make a question where need it to create a C++
> DLL to be used in C#, but monodevelop do not create c++ DLL, it create
> *.so, well, I find the solution here
>
> http://www.mono-project.com/Interop_with_Native_Libraries
>
> is the same as using C++ DLL from Windows, but with using .so library.
>
> A point to have in mind is the Marshaling of the managed C# data type to
> unmanaged C++ data type.
>
> for that we need to use a intPtr C# pointer and the data type in C# that
> we are using to marshaling for example
>
> C#:
> string name = "Victor";
> intPtr namePtr = Mono.Unix.UnixMarshal.StringToHeap (name);
>
> this is the equivalent for the c# string data type to char [], or char *
> in C++.
>
> greetings.
>

FYI, Mono team is also working on new project simplify using C/C++
libraries in C#.
You can check here
http://tirania.org/blog/archive/2011/Dec-19.html
https://github.com/mono/cxxi


>
>
>
> ____________________________________________
> Algunos suelen hayar su destino en el sendero que toman para evitarlo.
> ____________________________________________
> Tu mente es como el agua, cuando esta agitada se vuelve dificir ver, pero
> si dejas que se calme, la respuesta se vuelve clara.
> ____________________________________________
> El ayer es historia, el mañana es un misterio, pero el hoy es un obcequio,
> por eso se llama presente.
>
> _______________________________________________
> Monodevelop-list mailing list
> Monodevelop-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monodevelop-list


More information about the Monodevelop-list mailing list