#include "stdafx.h" #include "HelloSrv.h" #using #include #using #using using namespace System; int _tmain(void) { Server *oServer = new Server(); oServer->run(); return 0; } Server::Server() { } void Server::run( void) { Ics::Runtime::RuntimeConfiguration *rc = new Ics::Runtime::RuntimeConfiguration(); rc->SetApplicationLog(Ics::Runtime::OrbErrorLevel::ERRORS, "SrvLog.log", false); Ics::CORBA::ORB *m_oOrb = Ics::CORBA::_ORB::init(rc); m_oRootPOA = Ics::PortableServer::POAHelper::narrow( m_oOrb->resolve_initial_references( "RootPOA" )); m_oRootPOA->the_POAManager->activate(); Ics::CORBA::Object *obj = m_oRootPOA->servant_to_reference( new GreetingsImpl()); Ics::CORBA::_ORB::wrIORtoFile( "c:\\hello.ior", obj); Console::WriteLine("Server is running ... "); m_oOrb->run(); } String* GreetingsImpl::hello( String* a_strName ) { Console::WriteLine("\nFunction 'Hello', Parameter '{0}'\n", a_strName); return a_strName; }