[Mono-list] Passing class to c-function

Dominik Fretz lists@roboto.ch
Mon, 24 Mar 2003 09:41:25 +0100


I know, this isn't a mono-only facing questen, but in the end, it has to 
run on mono.

I'm currently helping in porting the SWT-Gtk toolkit to C# (comes from 
Ecplips and will be used as gui toolkit in Sharpdevelop to make it run 
on Linux.

Now we have to pass a C# Object (a class that holds some data) to a 
native function that makes the conversion between the Gtk-Object in 
C-Land and the Managed object from C#.
I know about gtk-sharp and I've tried to read some code there, but did't 
find a sollution, and we can't use gtk-sharp for now

We are able to pass C# structs to C. But structs bring in some problems 
(know inheritance, passing by value instead reference).

Can someone advice me how to pass a C# class to c and use it there for 
reading and writing data from/back to C#?

Thank You