summaryrefslogtreecommitdiff
path: root/cppe/demo/IceE/MFC/server/HelloServer.cpp
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2005-08-06 04:01:11 +0000
committerMatthew Newhook <matthew@zeroc.com>2005-08-06 04:01:11 +0000
commita8038f080bc2b991d854f64f2a074975c2463d37 (patch)
treeffcd7f03922d5a8f8620900e46ba4e4596e235b9 /cppe/demo/IceE/MFC/server/HelloServer.cpp
parentFixed slice file install (diff)
downloadice-a8038f080bc2b991d854f64f2a074975c2463d37.tar.bz2
ice-a8038f080bc2b991d854f64f2a074975c2463d37.tar.xz
ice-a8038f080bc2b991d854f64f2a074975c2463d37.zip
clean up MFC demo. Fix bug with the status bar.
Diffstat (limited to 'cppe/demo/IceE/MFC/server/HelloServer.cpp')
-rw-r--r--cppe/demo/IceE/MFC/server/HelloServer.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/cppe/demo/IceE/MFC/server/HelloServer.cpp b/cppe/demo/IceE/MFC/server/HelloServer.cpp
index d07740dd058..ee974b3aa8d 100644
--- a/cppe/demo/IceE/MFC/server/HelloServer.cpp
+++ b/cppe/demo/IceE/MFC/server/HelloServer.cpp
@@ -51,14 +51,29 @@ BOOL CHelloServerApp::InitInstance()
{
int argc = 0;
Ice::PropertiesPtr properties = Ice::createProperties();
+
+ //
+ // Set a default value for Hello.Endpoints so that the demo
+ // will run without a configuration file.
+ //
properties->setProperty("Hello.Endpoints", "tcp -p 10000");
- //properties->load("config");
+
+ //
+ // Now, load the configuration file if present.
+ //
+ try
+ {
+ properties->load("config");
+ }
+ catch(const Ice::FileException&)
+ {
+ }
communicator = Ice::initializeWithProperties(argc, 0, properties);
log = new LogI;
communicator->setLogger(log);
adapter = communicator->createObjectAdapter("Hello");
}
- catch(const Ice::Exception& ex)
+ catch(const IceUtil::Exception& ex)
{
AfxMessageBox(CString(ex.toString().c_str()), MB_OK|MB_ICONEXCLAMATION);
return FALSE;