Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / TAO / DevGuideExamples / LocalObjects / Messenger / MessengerServer.cpp
blobdca6a836668cb786ad194b3ebb2aa58fae73ad17
1 #include "Messenger_i.h"
2 #include <iostream>
3 int ACE_TMAIN (int, ACE_TCHAR **)
5 try {
6 // Construct a Messenger object and use it "as if" it's a corba object.
7 // Put it into CORBA object reference
8 // comparable to activation, narrow, etc.
9 Messenger_var messenger(new Messenger_i);
11 // Send a message the the Messenger object.
12 CORBA::String_var message = CORBA::string_dup ("Hello!");
13 messenger->send_message("TAO User", "TAO Test", message.inout());
15 // Print the Messenger's reply.
16 std::cout << "Reply: " << message.in() << std::endl;
18 catch(const CORBA::Exception& ex) {
19 std::cerr << "Caught CORBA::Exception : " << ex << std::endl;
20 return 1;
23 return 0;