Christian,

the method "getExistingBridges" only returns the instantiated remote bridges. If nothing is remotely connected to the office, there are no bridges to return.

Kay


Christian Junker wrote:
I was trying to get the names of the existing UNO bridges implemented
into the office.
When testing it from Starbasic, like so

<code>
Sub Main
bridgefac = createUNOService("com.sun.star.bridge.BridgeFactory")
msgbox UBound(bridgefac.getExistingBridges())
End Sub
</code>

the msgbox gives me a value of -1 back, indicating that there are no
existing bridges.
When trying this method from C++, like so

<code>
Reference < XBridgeFactory > xBridgeFactory(
        xMultiComponentFactoryServer->createInstanceWithContext(
            OUString(
RTL_CONSTASCII_USTRINGPARAM("com.sun.star.bridge.BridgeFactory" ) ),
            xComponentContext ), UNO_QUERY );

    /* looks for existing bridges and prints out the name of the first
bridge contained in the sequence returned by getExistingBridges()
    */
    OUString brname;
    Sequence< Reference< XBridge > > aBridgeSeq;
    if( xBridgeFactory.is() )
    {
        aBridgeSeq = xBridgeFactory->getExistingBridges();
        if (aBridgeSeq.hasElements())
           brname = aBridgeSeq.getArray()[0]->getName();
           printf("UNO bridge 1 is named\t%s\n", (char*) brname.getStr());
    }
</code>

the sequence returns one single bridge (I checked with getLength() on
the seq) with the name "u".

So my question is:
What does this method really return? The documentation talks about a
full list of all unnamed and named bridges, but yet it does only
return me 1 entry in C++ and nothing at all in SB.

Trying to extract some logic out of the results, it rather seems to me
as if the function only checks for the bridges that are currently in
active use, ie the cpp bridge would be used when calling from C++, but
then why is it named "u"?


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to