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

=?GB2312?B?0rG+p7XL?= fatfatson at gmail.com
Sat Jun 18 02:06:56 EDT 2011


hi,dear all..long time no see..now i return to the mono world and still feel
confused at the embed problem...
take the example of "ISomeClass"

there is a C++ class named "SomeClass",  then i'd like to export it to the
C# with the ability of creating instance and invoking method.
follow the suggestion of declare an interface "ISomeClass" in C#, then
problem comes:
1. there are actually two assemblies, one is the "LOGIC" who wants to use
the ISomeClass, and the other is "GLUE" who implements the ISomeClass( use
some unkown mechanism to forward the call to c++ code)
2.how do i succeed to compile the "LOGIC" code without a full implementation
of "ISomeClass" ?? at least it needs a "Creator" to get an ISomeClass
instance, but how to make it??
3.how do i generate the "GLUE" code at runtime?? and how to link it with the
"LOGIC" code ??

for a contrast, i simply descripe how i finish the same thing in LUA:
1.lua code can compile without any declaration and implementation of "extern
function".
2.at runtime, i use lua_register to export a C-Function to lua.

is there a simple method to archive the goal in mono??
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20110618/feddc187/attachment.html 


More information about the Mono-list mailing list