Date: prev next · Thread: first prev next last
2014 Archives by date, by thread · List index


For the code, below, when it calls  line numbered  “//D”, below….  “
Reference<XInterface> xInterface(
xServiceManager->createInstanceWithContext(service, xContext)); “

 

error msg is –abort() is returned.

 

I see that when interfaces or code is deprecated, its function returns
“abort()” .  Error code also references a cpp file and file line number:

/binaryurp/source/marshall.cxx   line 133 

 

But that offers little clue to me, at this stage.

 

Question:

                What is a proper C++ expression to to do:

Reference<XComponentLoader> xComponentLoader(   xInterface,
UNO_QUERY_THROW);

After this call then “//E” is called ….

 

(1)    Is the a putenv() variable..to do?

(2)    The fact that code sections , A,B,C worked.  Does this indicate that
libreoffice is properly setup?

(3)    My dev env is using cygwin64 and Visual Studio.

 

try { 

                // A ==èTHIS CODE SEGMENT WORKS

// Get the remote office component context 

                Reference<XComponentContext> xContext(bootstrap()); 

                if (! xContext.is()) 

                { 

                        std::cerr << "No component context!\n"; 

                        return false; 

                } 

                // B ==èTHIS CODE SEGMENT WORKS

                // Get the remote office service manager 

                Reference<XMultiComponentFactory>
xServiceManager(xContext->getServiceManager()); 

                if (! xServiceManager.is()) 

                { 

                        std::cerr << "No service manager!\n"; 

                        return false; 

                } 

                // C ==èTHIS CODE SEGMENT WORKS

                // Get an instance of the remote office desktop UNO service 

                // and query the XComponentLoader interface 

                OUString
service(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")); 

                Reference<XInterface> xInterface( 

                        xServiceManager->createInstanceWithContext(service,
xContext)); 

 

                // D ????? THIS CODE SEGMENT BOMBS

                                Reference<XComponentLoader>
xComponentLoader(   xInterface, UNO_QUERY_THROW);

 

 

                // E   NEXT CALL WOULD BE

 

                // Open a spreadsheet document 

                OUString
url(RTL_CONSTASCII_USTRINGPARAM("private:factory/scalc")); 

                OUString frameName(RTL_CONSTASCII_USTRINGPARAM("_blank")); 

                Reference<XComponent> xComponent = 

                        xComponentLoader->loadComponentFromURL(url,
frameName, 0, 

                        Sequence<PropertyValue>()); 

                        d_xComponent = xComponent;


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.