[Mono-dev] COM Interop, or something like it
Hello, In Microsoft’s implementation of .NET, it is possible to expose a class written in C# via a COM interface. This makes it possible (perhaps even easy!) to instantiate C# objects and call methods on them from, say, a native C++ application. Does Mono have a capability like this? In looking around, I’ve found vague references to Corba and Bonobo interop, but no specifics. It doesn’t matter much to me what specific technology is used, I’d just like an easy way to instantiate managed objects and interact with them from a native C++ application. I know I can embed Mono, and call methods that way, but it seems very cumbersome compared to COM interop. Is there a better way? Thanks! Kevin Ring ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] COM Interop, or something like it
Hi,I don't pretend to be an expert, but I believe the easier way is exposing the functionality through a web service.Regards,On 25/08/05, Ring, Kevin <[EMAIL PROTECTED]> wrote: Hello, In Microsoft's implementation of .NET, it is possible to expose a class written in C# via a COM interface. This makes it possible (perhaps even easy!) to instantiate C# objects and call methods on them from, say, a native C++ application. Does Mono have a capability like this? In looking around, I've found vague references to Corba and Bonobo interop, but no specifics. It doesn't matter much to me what specific technology is used, I'd just like an easy way to instantiate managed objects and interact with them from a native C++ application. I know I can embed Mono, and call methods that way, but it seems very cumbersome compared to COM interop. Is there a better way? Thanks! Kevin Ring ___Mono-devel-list mailing listMono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list -- Vladimir LushnikovC.E.O and Software DeveloperEverythingX Limited (http://www.everythingx.net)http://mireno.blogspot.com - "Of Life and Programming" ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] COM Interop, or something like it
AFAIK, there's no plans for COM-Interop or some other bridging/wrapping technology. It's way easier to do things in reverse (managed app calling native library) if it is possible. Also you can experiment with remoting using a corba or ice channel but as with COM-Interop performance will suffer greatly, and lifetime-managment will bring many-many bugs to the plate, also. Regards, On 8/25/05, Ring, Kevin <[EMAIL PROTECTED]> wrote: > > > > Hello, > > > > In Microsoft's implementation of .NET, it is possible to expose a class > written in C# via a COM interface. This makes it possible (perhaps even > easy!) to instantiate C# objects and call methods on them from, say, a > native C++ application. > > > > Does Mono have a capability like this? In looking around, I've found vague > references to Corba and Bonobo interop, but no specifics. It doesn't matter > much to me what specific technology is used, I'd just like an easy way to > instantiate managed objects and interact with them from a native C++ > application. I know I can embed Mono, and call methods that way, but it > seems very cumbersome compared to COM interop. Is there a better way? > > > > Thanks! > > Kevin Ring > > > ___ > Mono-devel-list mailing list > Mono-devel-list@lists.ximian.com > http://lists.ximian.com/mailman/listinfo/mono-devel-list > > > -- Rafael "Monoman" Teixeira --- I'm trying to become a "Rosh Gadol" before my own eyes. See http://www.joelonsoftware.com/items/2004/12/06.html for enlightment. It hurts! ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] COM Interop, or something like it
On Thu, 2005-08-25 at 16:27 -0400, Ring, Kevin wrote: > In Microsoft’s implementation of .NET, it is possible to expose a > class written in C# via a COM interface. This makes it possible > (perhaps even easy!) to instantiate C# objects and call methods on > them from, say, a native C++ application. > > Does Mono have a capability like this? Yes. Mono provides an embedding API which allows an unmanaged application to create and use managed objects: http://www.mono-project.com/Embedding_Mono This isn't terribly ideal, as it's a string-based API. There is a program called cilc which will take a managed class and generate a bunch of C wrappers for each method exposed by the class. This makes it easy to use a managed class from C (and thus C++, if not perfectly from C++). http://lists.ximian.com/pipermail/mono-list/2003-April/013529.html > I’d just like an easy way to instantiate managed objects and interact > with them from a native C++ application. I know I can embed Mono, and > call methods that way, but it seems very cumbersome compared to COM > interop. Is there a better way? Let cilc handle the cumbersome unmanaged->managed invocation layer. - Jon ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] COM Interop, or something like it
Its compatible the Microsoft implementation of Remoting with the Mono implementation???. -- Casiva Agustin, Desarrollador de Sistemas Cel: 03722-15554267 WebPage: www.casivaagustin.com.arMSN: [EMAIL PROTECTED] ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] COM Interop, or something like it
Remoting itself is compatible but the internal structure of classes has to be the same on both runtimes to allow object remoting. This means that you may want use classes that are not compatible with .NET. (It's easy to notice as you will get exceptions when receiving the object.) Then you can file a bug report or you may want to fix it and contribute it to Mono. But I (and others on the list) suggest to use web services instead as it is a much more standardized interop (and remoting) layer as remoting may change version to version but web services are guaranteed to work. Kornél - Original Message - From: "Agustin.PHP Casiva" <[EMAIL PROTECTED]> To: Sent: Friday, August 26, 2005 10:30 PM Subject: Re: [Mono-dev] COM Interop, or something like it Its compatible the Microsoft implementation of Remoting with the Mono implementation???. -- Casiva Agustin, Desarrollador de Sistemas Cel: 03722-15554267 WebPage: www.casivaagustin.com.ar <http://www.casivaagustin.com.ar> MSN: [EMAIL PROTECTED] ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
RE: [Mono-dev] COM Interop, or something like it
Thank you to everyone who responded! I hadn't found cilc in my searching before - it certainly makes the Embedded Mono approach seem less intimidating. In playing with it some today, I was able to get some simple unmanaged -> managed calls working on my Linux machine. I haven't had much luck on Windows, though, because of the dependency on glib. I know I can set up a whole Cygwin environment complete with glib and build my application there... but is there a way to embed Mono in an application built with Visual C++? I apologize if this is a stupid question. The purpose of all of this is to enable a large C++ application, which has been ported to Linux and other Unix platforms with the aid of MainWin, to continue to be portable as some of its components begin to be implemented in C#. So eventually, I'd like to have something that can generate real C++ interfaces in order to better approximate COM interop, which I suspect is what we'll be using on the Windows side. It sounds like it might not be terribly difficult to do this using an approach similar to the one used by cilc. I may be able to convince my company to sponsor a developer closer to the Mono project to develop such a thing, if that sounds at all interesting to anyone...just a thought. Thanks, Kevin Ring > -Original Message- > From: Jonathan Pryor [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 25, 2005 9:21 PM > To: Ring, Kevin > Cc: mono-devel-list@lists.ximian.com > Subject: Re: [Mono-dev] COM Interop, or something like it > > On Thu, 2005-08-25 at 16:27 -0400, Ring, Kevin wrote: > > In Microsoft's implementation of .NET, it is possible to expose a > > class written in C# via a COM interface. This makes it possible > > (perhaps even easy!) to instantiate C# objects and call methods on > > them from, say, a native C++ application. > > > > Does Mono have a capability like this? > > Yes. Mono provides an embedding API which allows an unmanaged > application to create and use managed objects: > > http://www.mono-project.com/Embedding_Mono > > This isn't terribly ideal, as it's a string-based API. There is a > program called cilc which will take a managed class and generate a bunch > of C wrappers for each method exposed by the class. This makes it easy > to use a managed class from C (and thus C++, if not perfectly from C++). > > http://lists.ximian.com/pipermail/mono-list/2003-April/013529.html > > > I'd just like an easy way to instantiate managed objects and interact > > with them from a native C++ application. I know I can embed Mono, and > > call methods that way, but it seems very cumbersome compared to COM > > interop. Is there a better way? > > Let cilc handle the cumbersome unmanaged->managed invocation layer. > > - Jon > ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list