[Mono-list] C#->C->C++, Platform Invocations from HELL!
Dallman, John
jgd at ugs.com
Mon Dec 11 05:31:38 EST 2006
Tyler Ballance wrote:
> I'm wondering if it is a plausible option to wrap the C++ shared
libraries with a C
> library, which would then be wrapped by the C# platform invocation
wrappers
> that I'd write, much in the same manner Mac OS X APIs perform
toll-free bridging
> between ObjC and C
(http://ridiculousfish.com/blog/archives/2006/09/09/bridge/)
>
> The most I have to worry about really in the context of C++ specific
code is sick
> iterator hacks and exceptions, but I don't think it isn't anything
that can't be wrapped
> by a simpleton C wrapper to provide a good p/invoke shim for Mono.
>
> Am I stretching too far?
Just about far enough, actually. I've only looked into this on Windows
with
MS.NET, but there, the object models for C# and native C++ have nothing
to do with each other, and C# cannot call native C++ object member
functions. A C wrapper layer is the only practical solution there, and I
suspect the same will hold on Mono. This just confirmed my opinion that
C++ may be a nice language for coding, but the complexity and fragility
of its interfaces disqualify it for APIs.
--
John Dallman, Parasolid Porting Engineer, +44-1223-371554
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20061211/23d85a5e/attachment.html
More information about the Mono-list
mailing list