[Mono-dev] Trying to use uno binding for mono
Jon Chambers
joncham at gmail.com
Tue Oct 17 09:56:21 EDT 2006
In regards to using the COM Interop infrastructure to access UNO, there is 2
possibilities. I now absolutely nothing about UNO so I'm not sure which, if
either, is viable.
If UNO is binary compatible with COM on Windows, and XPCOM on Linux it
*should* work with the COM Interop work that is almost done. You'll have to
create the objects a bit differently; I can explain in more detail if
needed. The UNO website also mentions a COM bridge, but again I have no
experience with UNO.
If UNO is not binary compatible, but has a functionality similar to
IDispatch (i.e. Automation) then this approach could be used. It would be
slower than the first approach I think, but would still be acceptable (the
speed of a scripting language, or late binding in VB). This functionality is
currently not implemented in mono.
If all else fails, you could emit the required wrappers in IL. I did
something like this prior to working on COM Interop in mono. I personally
think it would be better to get something work with COM Interop if possible.
The more people using the a feature would help flush out bugs and probably
ease maintenance.
If anyone has experience with UNO and wants to give it a shot, contact me
and we can try to get something working. I'll be at the mono meeting if
anyone else interested in this will be there.
- Jonathan
On 10/16/06, Daniel Morgan <monodanmorg at yahoo.com> wrote:
>
> You will not get much replies on the mono lists. Try
> the OpenOffice.org Ximian Edition mailing list.
>
> http://lists.ximian.com/mailman/listinfo/openoffice
>
> As far as I know, the UNO Bridge for the CLI only
> works on .NET/Windows. You need a special UNO Bridge
> for Mono which is only available via the ooo-build
> 680. If you have Suse Linux 10, you may already have
> it. Other distros do not have it unless you build it
> from your distros source of oo. Vanilla oo source
> from upstream may not have it.
>
> Also, it may help to join IRC channels #go-oo and
> #openoffice.org at irc.freenode.net.
>
> Michael Meeks maybe able to help you.
>
> I've tried using the CLI Bridge with Mono and it fails
> for me too on Windows. This is a shame since the only
> way we are going to go to OpenOffice.org is if we get
> all our .net code working on it.
>
> Currently, Managed C++ is used to build the CLI
> Bridge. Michael Meeks suggested to re-write the
> Mono/CLI Bridge to emit IL on-the-fly. Maybe
> Mono.Cecil could be used to do this. Or CodeDom or
> Reflection.Emit.
>
> Zoltan has gotten Mono to work with the Mono Bridge in
> the past. I wonder if he could provide any ideas.
>
> And Jonathon Chambers has added code to Mono for COM
> Interop and is researching on how to get Mozilla XPCOM
> to interop as well. He maybe to provide insights into
> getting Mono to interop with UNO.
>
> Martin Kretzschmar was the original programmer who
> created the Mono Bridge.
>
>
> --- Hubert FONGARNAND
> <informatique.internet at fiducial.fr> wrote:
>
> > I've installed UNO bindings for C#/mono on my dev
> > machine...
> >
> > When i try to run this
> > public static void Main(string[] args)
> > {
> > Console.WriteLine("Hello World!");
> > MainClass main=new MainClass();
> > main.Run();
> >
> > }
> >
> > private void Run()
> > {
> > mxMSFactory = connect();
> >
> > // Create a new spreadsheet document
> > mxDocument = initDocument();
> > }
> >
> >
> > private XMultiServiceFactory connect( )
> > {
> >
> > m_xContext =
> > uno.util.Bootstrap.bootstrap();
> >
> > return (XMultiServiceFactory)
> > m_xContext.getServiceManager();
> > }
> >
> > I get:
> >
> >
> >
> >
> >
> =================================================================
> > Got a SIGSEGV while executing native code. This
> > usually indicates
> > a fatal error in the mono runtime or one of the
> > native libraries
> > used by your application.
> >
> =================================================================
> >
> > Stacktrace:
> >
> > at (wrapper managed-to-native)
> > uno.util.Bootstrap.native_bootstrap ()
> > <0x00004>
> > at (wrapper managed-to-native)
> > uno.util.Bootstrap.native_bootstrap ()
> > <0xffffffff>
> > at uno.util.Bootstrap.bootstrap () <0x0000d>
> > at testoo.MainClass.connect () <0x00012>
> > at testoo.MainClass.Run () <0x00012>
> > at testoo.MainClass.Main (string[]) <0x00036>
> > at (wrapper runtime-invoke)
> > System.Object.runtime_invoke_void_string[]
> > (object,intptr,intptr,intptr) <0xffffffff>
> >
> > Native stacktrace:
> >
> > mono [0x8162486]
> > mono [0x814c2a3]
> > [0xb7f62440]
> >
> >
> /usr/lib/openoffice/program/libcli_uno.so(uno_ext_getMapping
> > +0xee) [0xb3f4307e]
> > /usr/lib/openoffice/program/libuno_cppu.so.3
> > [0xb6fbf634]
> > /usr/lib/openoffice/program/libuno_cppu.so.3
> > [0xb6fbfbb4]
> > /usr/lib/openoffice/program/libuno_cppu.so.3
> > [0xb6fbfdac]
> >
> >
> /usr/lib/openoffice/program/libuno_cppu.so.3(uno_getMapping
> > +0x68c) [0xb6fc0938]
> >
> >
> /usr/lib/openoffice/program/libuno_cppu.so.3(uno_getMappingByName+0x98)
> > [0xb6fc0abc]
> >
> > /usr/lib/openoffice/program/libcli_uno_glue.so
> > [0xb79f27c4]
> >
> > /usr/lib/openoffice/program/libcli_uno_glue.so
> > [0xb79f235a]
> >
> >
> /usr/lib/openoffice/program/libcli_uno_glue.so(native_bootstrap
> > +0x26) [0xb79f2420]
> > [0xb79fd261]
> > [0xb79fd166]
> > [0xb79fd08b]
> > [0xb79fd03b]
> > [0xb79f7877]
> > [0xb79f77c3]
> > mono(mono_runtime_exec_main+0x60)
> > [0x80d6730]
> > mono(mono_runtime_run_main+0x21f)
> > [0x80d6a9f]
> > mono(mono_main+0xf17) [0x8058d77]
> > mono [0x805797e]
> > /lib/libc.so.6(__libc_start_main+0xe6)
> > [0xb7d56866]
> > mono(dl_iterate_phdr+0x191) [0x80578c1]
> >
> > Debug info from gdb:
> >
> > Using host libthread_db library
> > "/lib/libthread_db.so.1".
> > [Thread debugging using libthread_db enabled]
> > [New Thread -1210882368 (LWP 11059)]
> > [New Thread -1267319904 (LWP 11485)]
> > [New Thread -1258861664 (LWP 11483)]
> > [New Thread -1249965152 (LWP 11063)]
> > [New Thread -1229464672 (LWP 11062)]
> > [New Thread -1221407840 (LWP 11061)]
> > [New Thread -1221391456 (LWP 11060)]
> > 0xb7f62410 in ?? ()
> > 7 Thread -1221391456 (LWP 11060) 0xb7f62410 in ??
> > ()
> > 6 Thread -1221407840 (LWP 11061) 0xb7f62410 in ??
> > ()
> > 5 Thread -1229464672 (LWP 11062) 0xb7f62410 in ??
> > ()
> > 4 Thread -1249965152 (LWP 11063) 0xb7f62410 in ??
> > ()
> > 3 Thread -1258861664 (LWP 11483) 0xb7f62410 in ??
> > ()
> > 2 Thread -1267319904 (LWP 11485) 0xb7f62410 in ??
> > ()
> > 1 Thread -1210882368 (LWP 11059) 0xb7f62410 in ??
> > ()
> >
> > Thread 7 (Thread -1221391456 (LWP 11060)):
> > #0 0xb7f62410 in ?? ()
> > #1 0xb7330438 in ?? ()
> > #2 0x081f0358 in ?? ()
> > #3 0x00000000 in ?? ()
> >
> > Thread 6 (Thread -1221407840 (LWP 11061)):
> > #0 0xb7f62410 in ?? ()
> > #1 0xb732c238 in ?? ()
> > #2 0x00000001 in ?? ()
> > #3 0x00000000 in ?? ()
> >
> > Thread 5 (Thread -1229464672 (LWP 11062)):
> > #0 0xb7f62410 in ?? ()
> > #1 0xb6b7d41c in ?? ()
> > #2 0x00000001 in ?? ()
> > #3 0x00000000 in ?? ()
> >
> > Thread 4 (Thread -1249965152 (LWP 11063)):
> > #0 0xb7f62410 in ?? ()
> > #1 0xb57f0400 in ?? ()
> > #2 0x00000000 in ?? ()
> >
> > Thread 3 (Thread -1258861664 (LWP 11483)):
> > #0 0xb7f62410 in ?? ()
> > #1 0xb4f7438c in ?? ()
> > #2 0x00000003 in ?? ()
> > #3 0x00000000 in ?? ()
> >
> > Thread 2 (Thread -1267319904 (LWP 11485)):
> > #0 0xb7f62410 in ?? ()
> > #1 0xb47631a8 in ?? ()
> > #2 0xb718c0dc in ?? () from
> > /usr/lib/openoffice/program/libuno_sal.so.3
> > #3 0xb4763194 in ?? ()
> > #4 0xb7e89e78 in recv () from /lib/libpthread.so.0
> > #5 0xb6ff8363 in osl_receivePipe ()
> > from /usr/lib/openoffice/program/libuno_sal.so.3
> > #6 0xb6ff8464 in osl_readPipe ()
> > from /usr/lib/openoffice/program/libuno_sal.so.3
> > #7 0xb4fe34fa in component_getFactory ()
> > from /usr/lib/openoffice/program/connector.uno.so
> > #8 0xb4fbd3b2 in component_getFactory ()
> > from
> > /usr/lib/openoffice/program/remotebridge.uno.so
> > #9 0xb4fa5a55 in component_canUnload ()
> > from /usr/lib/openoffice/program/liburp_uno.so
> > #10 0xb4fa34d0 in component_canUnload ()
> > from /usr/lib/openoffice/program/liburp_uno.so
> > #11 0xb4f99885 in component_canUnload ()
> > from /usr/lib/openoffice/program/liburp_uno.so
> > #12 0xb6ff07d3 in osl_yieldThread ()
> > from /usr/lib/openoffice/program/libuno_sal.so.3
> > #13 0xb7e84512 in start_thread () from
> > /lib/libpthread.so.0
> > #14 0xb7df9fce in clone () from /lib/libc.so.6
> >
> > Thread 1 (Thread -1210882368 (LWP 11059)):
> > #0 0xb7f62410 in ?? ()
> > #1 0xbfd2dff8 in ?? ()
> > #2 0x00000000 in ?? ()
> > #0 0xb7f62410 in ?? ()
> >
> > Abandon
> >
> >
> > Does these bindings are known to work with mono
> > 1.1.18?
> >
> === message truncated ===>
> _______________________________________________
> > Mono-devel-list mailing list
> > Mono-devel-list at lists.ximian.com
> >
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20061017/78cfdd86/attachment.html
More information about the Mono-devel-list
mailing list