[Mono-list] how to "register" a c++ class to c#?
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
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
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...
More information about the Mono-list