C++ code question. Open a s/h document.

nicholas ferguson nicholasferguson at wingarch.com
Sun Sep 28 11:07:41 PDT 2014


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;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20140928/c6f9ff68/attachment.html>


More information about the LibreOffice mailing list