First steps UNO/C++

Java, C++, C#, Delphi, ??? - Using the UNO bridges

First steps UNO/C++

Postby petric » Wed Dec 28, 2011 7:19 pm


i tried the code at using LibreOffice on Gentoo Linux (64 Bit).

During execution - after the main lirbreoffice window came up i got a segmentation fault. This is the code i used:

Code: Select all   Expand viewCollapse view
      Reference<XComponentContext> rComponentContext = ::cppu::bootstrap ();
      Reference<XMultiComponentFactory> xServiceManager = rComponentContext->getServiceManager ();
      Reference<XInterface> xDesktop = xServiceManager->createInstanceWithContext (OUString::createFromAscii (""), rComponentContext);
      Reference<XComponentLoader> xCompLoader (xDesktop, UNO_QUERY);

      Sequence< ::com::sun::star::beans::PropertyValue> props (1);
      props[0].Name = OUString::createFromAscii ("AsTemplate");
      props[0].Value <<= OUString::createFromAscii ("MS Excel 97");

      // calling this i get a segmentation fault
      Reference<XComponent> component = xCompLoader->loadComponentFromURL (OUString::createFromAscii ("private:factory/scalc"),
                                                                           OUString::createFromAscii ("_default"),
      // get a handle to the newly created spreadsheet
      Reference<XSpreadsheetDocument> spreadDoc (component, UNO_QUERY);

Compiler is gcc 4.5.3.

Any hints ?
LibreOffice, Gentoo Linux 64Bit
Posts: 1
Joined: Wed Dec 28, 2011 7:06 pm

Return to External Programs

Who is online

Users browsing this forum: No registered users and 2 guests