[Mono-list] accessing struct instance from managed code

Nigel Benns nigel_benns@rogers.com
Fri, 25 Feb 2005 14:02:56 -0500 (EST)

ok... this is the lowdown :)

in C:

struct try {

   int *blah;


int main() {

   object *meh;
   int *thing;

   meh = try_new();

   thing = meh->blah; //this is what I want to do from C#


I have created a handleref to the instance, but I have know idea how to
access that. Do I need to create some glue in C like this:

int* getblah(try *obj) {

   return obj->blah;


or use Marshal.PtrToStruct somehow to get this to work.
I would rather do without the glue if I can.

Help would be GREATLY appreciated.