<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1552765334;
        mso-list-type:hybrid;
        mso-list-template-ids:977958386 1542194172 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-text:"\(%1\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:.75in;
        text-indent:-.25in;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal style='margin-left:.5in'>For the code, below, when it calls  line numbered  “//D”, below….  “ Reference<XInterface> xInterface(  xServiceManager->createInstanceWithContext(service, xContext)); “<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><p class=MsoNormal style='margin-left:.5in'>error msg is –abort() is returned.<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><p class=MsoNormal style='margin-left:.5in'>I see that when interfaces or code is deprecated, its function returns “abort()” .  Error code also references a cpp file and file line number:<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>/binaryurp/source/marshall.cxx   line 133 <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><p class=MsoNormal style='margin-left:.5in'>But that offers little clue to me, at this stage.<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><p class=MsoNormal>Question:<o:p></o:p></p><p class=MsoNormal>                What is a proper C++ expression to to do:<o:p></o:p></p><p class=MsoNormal style='text-indent:.5in'>Reference<XComponentLoader> xComponentLoader(   xInterface, UNO_QUERY_THROW);<o:p></o:p></p><p class=MsoNormal style='text-indent:.5in'>After this call then “//E” is called ….<o:p></o:p></p><p class=MsoNormal style='text-indent:.5in'><o:p> </o:p></p><p class=MsoListParagraph style='margin-left:.75in;text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='mso-list:Ignore'>(1)<span style='font:7.0pt "Times New Roman"'>    </span></span><![endif]>Is the a putenv() variable..to do?<o:p></o:p></p><p class=MsoListParagraph style='margin-left:.75in;text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='mso-list:Ignore'>(2)<span style='font:7.0pt "Times New Roman"'>    </span></span><![endif]>The fact that code sections , A,B,C worked.  Does this indicate that libreoffice is properly setup?<o:p></o:p></p><p class=MsoListParagraph style='margin-left:.75in;text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='mso-list:Ignore'>(3)<span style='font:7.0pt "Times New Roman"'>    </span></span><![endif]>My dev env is using cygwin64 and Visual Studio.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>try { <o:p></o:p></p><p class=MsoNormal>                // A ==<span style='font-family:Wingdings'>è</span>THIS CODE SEGMENT WORKS<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in;text-indent:.5in'>// Get the remote office component context <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>                Reference<XComponentContext> xContext(bootstrap()); <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>                if (! xContext.is()) <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>                { <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>                        std::cerr << "No component context!\n"; <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>                        return false; <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>                } <o:p></o:p></p><p class=MsoNormal>                // B ==<span style='font-family:Wingdings'>è</span>THIS CODE SEGMENT WORKS<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>                // Get the remote office service manager <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>                Reference<XMultiComponentFactory> xServiceManager(xContext->getServiceManager()); <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>                if (! xServiceManager.is()) <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>                { <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>                        std::cerr << "No service manager!\n"; <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>                        return false; <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>                } <o:p></o:p></p><p class=MsoNormal>                // C ==<span style='font-family:Wingdings'>è</span>THIS CODE SEGMENT WORKS<o:p></o:p></p><p class=MsoNormal style='text-indent:.5in'>                // Get an instance of the remote office desktop UNO service <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>                // and query the XComponentLoader interface <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>                OUString service(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")); <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>                Reference<XInterface> xInterface( <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>                        xServiceManager->createInstanceWithContext(service, xContext)); <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><p class=MsoNormal>                // D ????? THIS CODE SEGMENT BOMBS<o:p></o:p></p><p class=MsoNormal>                                Reference<XComponentLoader> xComponentLoader(   xInterface, UNO_QUERY_THROW);<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>                // E   NEXT CALL WOULD BE<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>                // Open a spreadsheet document <o:p></o:p></p><p class=MsoNormal>                OUString url(RTL_CONSTASCII_USTRINGPARAM("private:factory/scalc")); <o:p></o:p></p><p class=MsoNormal>                OUString frameName(RTL_CONSTASCII_USTRINGPARAM("_blank")); <o:p></o:p></p><p class=MsoNormal>                Reference<XComponent> xComponent = <o:p></o:p></p><p class=MsoNormal>                        xComponentLoader->loadComponentFromURL(url, frameName, 0, <o:p></o:p></p><p class=MsoNormal>                        Sequence<PropertyValue>()); <o:p></o:p></p><p class=MsoNormal>                        d_xComponent = xComponent;<o:p></o:p></p></div></body></html>