On 23/05/2019 17:18, Manfred Rebentisch wrote:
Hi, if I start soffice with --accept="socket,host=localhost,port=2083;urp;StarOffice.ServiceManager" it runs normal. But if I want to connect from client C++ programm: sConnectionString = "socket,host=localhost,port=2083;urp;StarOffice.ServiceManager"; xContextM = ::cppu::defaultBootstrap_InitialComponentContext(); xServiceManagerM = xContextM->getServiceManager(); xResolverM = Reference< XUnoUrlResolver > (xInterfaceM, UNO_QUERY); xInterfaceM = Reference< XInterface >( xResolverM->resolve( sConnectionString ), UNO_QUERY ); it throws an exception with: "UNO URL does not start with "uno:" "
The soffice --accept command-line option and the UNO css.bridge.UnoUrlResolver service expect different kinds of arguments. The latter is documented to expect a full uno URL (see <http://udk.openoffice.org/common/man/spec/uno-url.html>), while the former takes only connection-type,params and optional (defaulting to "urp") protocol-name,params parts of such a URL. (Though the former was mis-documented to also take a uno URL, see <https://gerrit.libreoffice.org/#/c/72859/> "Fix documented 'soffice --accept' parameter syntax") for fixing that.
So run `soffice --accept=socket,host=localhost,port=2083\;urp` but call xResolver->resolve("uno:socket,host=localhost,port=2083;urp;StarOffice.ServiceManager").
_______________________________________________ LibreOffice mailing list LibreOffice@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/libreoffice