Code: Select all
Reference< XComponentContext > xComponentContext(::cppu::defaultBootstrap_InitialComponentContext());
Reference< XMultiComponentFactory > xMultiComponentFactoryClient(
xComponentContext->getServiceManager() );
Reference< XInterface > xInterface =
xMultiComponentFactoryClient->createInstanceWithContext(
OUString::createFromAscii( "com.sun.star.bridge.UnoUrlResolver" ),
xComponentContext );
It breaks in createInstanceWithContext throwing a CannotActivateFactoryException with the message 'Cannot load component library : /program/uuresolver.uno.so'.
After many trials, I desperately created /program in the filesystem and copied there uuresolver.uno.so. It then missed 'connector.uno.so', then 'binaryurp.uno.so'. When these two more files are copied in /program, AOO gets started from C++. But exporting a Writer text document to PDF will just fail, no PDF file is created. That is the program's intent.
If AOO is bootstrapped as follows :
Code: Select all
xRemoteContext = Reference< XComponentContext >( ::cppu::bootstrap() );
xRemoteServiceManager = Reference< XMultiComponentFactory >(xRemoteContext->getServiceManager() );
RemoteDesktop = Reference < XComponentLoader >(xRemoteServiceManager->createInstanceWithContext(
OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ) ),
xRemoteContext ), UNO_QUERY_THROW );
everything works seamlessly.
I just wish to start AOO externally with 'soffice -accept="socket,host=127.0.0.1,port=2083;urp;StarOffice.ServiceManager" -headless' and connect instances of the custom program to this listening instance remotely.
I'm using buildid=450m1(Build:9900) Revision=0cf988a7ab and buildid=420m1(Build:9800) Revision=1849999.
Creating a /program directory is not a solution of course. Please advise how to resolve this.
Thanks.