| View previous topic :: View next topic |
| Author |
Message |
hardik General User

Joined: 16 Mar 2007 Posts: 5 Location: India
|
Posted: Tue Jul 24, 2007 2:05 am Post subject: Connection Problem with PyUNO |
|
|
Hello,
While working with PyUNO i have to every time write
soffice -accept=socket,host=0,port=2002;urp;
or ,
<prop oor:name="ooSetupConnectionURL">
<value>socket,host=localhost,port=2002;urp;StarOffice.ServiceManager
</value>
</prop>
in setup.xcw file
but i want to do it by coding
is it possible ?????
Then please provide it as soon as fast ...... |
|
| Back to top |
|
 |
SergeM Super User

Joined: 09 Sep 2003 Posts: 3211 Location: Troyes France
|
Posted: Tue Jul 24, 2007 8:29 am Post subject: |
|
|
perhaps a clue with DannyB's code in OOoBasic :
| Code: | Sub btnAccept_Clicked()
' Get access to the controls on the drawing.
oDrawDoc = ThisComponent ' get the drawing.
oDrawPage = oDrawDoc.getDrawPages().getByIndex( 0 ) ' get a page from the drawing.
oForms = oDrawPage.getForms() ' get the group of forms on the page.
oForm = oForms.getByName( "Standard" ) ' get a particular form.
' Get user entered values from the drawing.
cConnectionsFrom = oForm.getByName( "fldConnectionsFrom" ).Text
nConnectionPort = oForm.getByName( "fldConnectionPort" ).Value
' SetUnoConnectionURL( "socket,host=0,port=8100;urp;StarOffice.ServiceManager" )
SetUnoConnectionURL( "socket,host=" + cConnectionsFrom _
+ ",port=" + CSTR( nConnectionPort )_
+ ";urp;StarOffice.ServiceManager" )
End Sub |
Note that this code use a form but you can probably simplfy it. _________________ Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|