// $Revision: 1.4 $ // Copyright (C) 1994-1995 Taligent, Inc. All rights reserved. #ifndef TaligentSamples_ADDITIONCALLER #include "AdditionCaller.h" #endif #ifndef Taligent_LOCALSERVICE #include #endif #ifndef Taligent_MESSAGESTREAMSTRANSPORT #include #endif #ifndef IOSTREAMH #include // Included for cout #endif #ifndef _H_LIMITS #include #endif void main() { TAdditionCaller caller(TLocalServiceReference(TLocalObjectName("RPCAdditionDispatcher"))); long num1 = 6; long num2 = 7; long result = 0; //------------ result = caller.Add(num1, num2); cout << endl << "Adding " << num1 << " to " << num2 << " gives us: " << result << endl; //------------ cout << endl << "Adding one to " << num2 << " gives us: "; caller.AddOne(num2); cout << num2 << endl; //------------ long num3 = 2; cout << "Adding " << LONG_MAX << " to " << num3 << endl; result = 0; try { result = caller.Add(LONG_MAX, num3); } catch (TMathException& exception) { cout << "*** Caught math exception while trying to add " << LONG_MAX << " and " << num3 << " ***" << endl; } caller.ExitDispatcher(); }