diff options
author | Rüdiger Timm <rt@openoffice.org> | 2008-07-11 13:18:02 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2008-07-11 13:18:02 +0000 |
commit | 58e79a27d273e967cbe81a91b3bab67d26389565 (patch) | |
tree | e9835d341b61a9897e2a88e654af7df689ce6955 /odk/examples/DevelopersGuide | |
parent | aaebbb0e597bfeb8e1c545130a0d17a55b164228 (diff) |
INTEGRATION: CWS jsc21 (1.5.92); FILE MERGED
2008/07/07 11:37:32 jsc 1.5.92.1: #i88797# adapted
Diffstat (limited to 'odk/examples/DevelopersGuide')
-rw-r--r-- | odk/examples/DevelopersGuide/Components/CppComponent/TestCppComponent.cxx | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/odk/examples/DevelopersGuide/Components/CppComponent/TestCppComponent.cxx b/odk/examples/DevelopersGuide/Components/CppComponent/TestCppComponent.cxx index 999808c8cfe4..afda5d3cdeba 100644 --- a/odk/examples/DevelopersGuide/Components/CppComponent/TestCppComponent.cxx +++ b/odk/examples/DevelopersGuide/Components/CppComponent/TestCppComponent.cxx @@ -2,9 +2,9 @@ * * $RCSfile: TestCppComponent.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: kz $ $Date: 2006-11-06 14:59:41 $ + * last change: $Author: rt $ $Date: 2008-07-11 14:18:02 $ * * The Contents of this file are made available subject to the terms of * the BSD license. @@ -38,14 +38,13 @@ * *************************************************************************/ -#include <iostream> +#include <stdio.h> #include <cppuhelper/bootstrap.hxx> #include <com/sun/star/bridge/XUnoUrlResolver.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> #include <my_module/MyService1.hpp> #include <my_module/MyService2.hpp> -using namespace std; using namespace rtl; using namespace com::sun::star::uno; //namespace cssuno = ::com::sun::star::uno; @@ -58,7 +57,7 @@ int SAL_CALL main( int, char ** ) { // get the remote office component context Reference< XComponentContext > xContext( ::cppu::bootstrap() ); - cout << "\nconnected to a running office...\n"; + fprintf(stdout, "\nconnected to a running office...\n"); // create a new instance of MyService1 Reference<my_module::XSomething> xSomething = @@ -66,34 +65,28 @@ int SAL_CALL main( int, char ** ) // call methodOne and print the return value on stdout OUString s = xSomething->methodOne(OUString(RTL_CONSTASCII_USTRINGPARAM("Hello World!"))); - cout << "\nCreate new instance of MyService1\n" - << "Call of XSomething.methOne at MyService1 = " - << OUStringToOString( s, RTL_TEXTENCODING_ASCII_US ).getStr(); + fprintf(stdout,"\nCreate new instance of MyService1\nCall of XSomething.methOne at MyService1 = %s", OUStringToOString( s, RTL_TEXTENCODING_ASCII_US ).getStr()); // create a new instance of MyService2 with the specified string argument xSomething = my_module::MyService2::create(xContext, OUString(RTL_CONSTASCII_USTRINGPARAM("Hello My World!"))); // call methodTwo and print the return value of methodTwo s = xSomething->methodTwo(); - cout << "\n\nCreate new instance of MyService2 with argument\n" - << "Call of XSomething.methTwo at MyService2 = " - << OUStringToOString( s, RTL_TEXTENCODING_ASCII_US ).getStr(); + fprintf(stdout, "\n\nCreate new instance of MyService2 with argument\nCall of XSomething.methTwo at MyService2 = %s", OUStringToOString( s, RTL_TEXTENCODING_ASCII_US ).getStr()); - cout <<"\n\nPlease press 'return' to finish the example!\n"; + fprintf(stdout, "\n\nPlease press 'return' to finish the example!\n"); getchar(); } catch ( ::cppu::BootstrapException & e ) { - cerr << "\ncaught BootstrapException: " - << OUStringToOString( e.getMessage(), RTL_TEXTENCODING_ASCII_US ).getStr() - << '\n'; + fprintf(stderr, "\ncaught BootstrapException: %s\n", + OUStringToOString( e.getMessage(), RTL_TEXTENCODING_ASCII_US ).getStr()); return 1; } catch ( Exception & e ) { - cerr << "\ncaught UNO exception: " - << OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() - << '\n'; + fprintf(stderr, "\ncaught UNO exception: %s\n", + OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr()); return 1; } |