OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Question about Open Office C++ Interface

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
SSMela
General User
General User


Joined: 06 Mar 2007
Posts: 8

PostPosted: Tue Mar 20, 2007 6:33 am    Post subject: Question about Open Office C++ Interface Reply with quote

In the Developer's Guide I see the following example:

Code:
 // instantiate a sample service with the service manager.
    Reference< XInterface > rInstance =rServiceManager->createInstanceWithContext(
         OUString::createFromAscii("com.sun.star.bridge.UnoUrlResolver" ),
         rComponentContext );


I assume that the createInstanceWithContext method interface has been exported to C++.

(1) I am curious where I would find the header file for this.
(2) Would it have been theoretically possible for the creators of the C++ interface to export createInstanceWithContext in such a way that it would be unnecessary for the programmer to do a OUString::createFromAscii("com.sun.star.bridge.UnoUrlResolver" ) conversion? In other words, could an interface which takes a native c++ string have been possible? I expect this was some sort of a key design decision, and I am guessing it could have been done this way but it might have been more complicated.

Thank you very much for your answers.
Back to top
View user's profile Send private message
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Tue Mar 20, 2007 7:04 am    Post subject: Reply with quote

1) I don't know exactly where the prototype is.
2) No because OUString is OOo standard in every programming languages.
_________________
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
View user's profile Send private message Visit poster's website
SSMela
General User
General User


Joined: 06 Mar 2007
Posts: 8

PostPosted: Tue Mar 20, 2007 7:29 am    Post subject: Reply with quote

Why can't the exported interface perform an implied conversion from char * to OUString?

It looks to me as though the OUString is a C++ class.

Why not give the C++ class a constructor that accepts char * as its parameter?
Back to top
View user's profile Send private message
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Wed Mar 21, 2007 8:52 am    Post subject: Reply with quote

Have you read my document ? Here is a chapter where OUString and OString are explained :
The UNO C++ Language http://wiki.services.openoffice.org/wiki/SDKCppLanguage
The complete document is available here :
Using Cpp with the OOo SDK http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
_________________
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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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