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

Hello,

i tried the code at http://user.services.openoffice.org/en/forum/viewtopic.php?f=44&t=20353&p=94720#p94720 using LibreOffice 3.4.3.2 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 ("com.sun.star.frame.Desktop"), 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"),
                                                                           0,
                                                                           props);
      // get a handle to the newly created spreadsheet
      Reference<XSpreadsheetDocument> spreadDoc (component, UNO_QUERY);


Compiler is gcc 4.5.3.

Any hints ?
LibreOffice 3.4.3.2, Gentoo Linux 64Bit
petric
 
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