[Mono-list] how to "register" a c++ class to c#?

Christopher David Howie me at chrishowie.com
Sun Jun 6 23:29:16 EDT 2010


On 06/06/2010 11:13 PM, 冶晶邓 wrote:
> hi,David! i don't think we need facing the name-mangling problem,
> because i just need a way to "export" a C function pointer to c# at
> runtime, by placing the "&" operator before a function name, i can get
> its address, then pass it as an userdata to C# and when call in C#, it
> should pass the userdata back to me so i can make a call to the real
> function.
> as i know , all the above is implemented as the "P/Invoke" now, but what
> i need additonally is how to create a C# class on the fly, then use some
> C functions to pretend as its method. is this ok?

I'm confused.  Are you trying to embed Mono in another program, or are
you trying to use a C++ class from C#?  The "direction" you are trying
to do things will change the approach you need to take.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5

------------------------------------------------------------------------
                    IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses you are
agreeing that I am, by definition, "the intended recipient," and that I
may do whatever I wish with the contents of any message you send me,
unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.


More information about the Mono-list mailing list