/* Gets the service manager instance to be used (or null). This method has beenaddedforconvenience,becausetheservicemanagerisanoftenused object.
*/
Reference< XMultiComponentFactory > xMultiComponentFactoryClient(
xComponentContext->getServiceManager() );
/* Creates an instance of a component which supports the services specified bythefactory.
*/
Reference< XInterface > xInterface =
xMultiComponentFactoryClient->createInstanceWithContext( "com.sun.star.bridge.UnoUrlResolver",
xComponentContext );
// Resolves the component context from the office, on the uno URL given by argv[1]. try
{
xInterface = Reference< XInterface >(
resolver->resolve( sConnectionString ), UNO_QUERY );
} catch ( Exception& e )
{
std::cout << "Error: cannot establish a connection using "
<< sConnectionString << std::endl << e.Message << std::endl; exit(1);
}
// gets the server component context as property of the office component factory
Reference< XPropertySet > xPropSet( xInterface, UNO_QUERY );
xPropSet->getPropertyValue("DefaultContext") >>= xComponentContext;
// gets the service manager from the office
Reference< XMultiComponentFactory > xMultiComponentFactoryServer(
xComponentContext->getServiceManager() );
/* Creates an instance of a component which supports the services specified bythefactory.Important:usingtheofficecomponentcontext.
*/
Reference < XDesktop2 > xComponentLoader = Desktop::create(xComponentContext);
/* Loads a component specified by a URL into the specified new or existing frame.
*/
OUString sAbsoluteDocUrl, sWorkingDir, sDocPathUrl, sArgDocUrl;
rtl_getAppCommandArg(0, &sArgDocUrl.pData);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.