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

Joined: 06 Mar 2007 Posts: 8
|
Posted: Tue Mar 20, 2007 6:33 am Post subject: Question about Open Office C++ Interface |
|
|
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 |
|
 |
SergeM Super User

Joined: 09 Sep 2003 Posts: 3211 Location: Troyes France
|
|
| Back to top |
|
 |
SSMela General User

Joined: 06 Mar 2007 Posts: 8
|
Posted: Tue Mar 20, 2007 7:29 am Post subject: |
|
|
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 |
|
 |
SergeM Super User

Joined: 09 Sep 2003 Posts: 3211 Location: Troyes France
|
|
| Back to top |
|
 |
|