summaryrefslogtreecommitdiff
path: root/cppe/demo/IceE/minimal/WinCEClient.cpp
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2005-08-09 03:44:48 +0000
committerMatthew Newhook <matthew@zeroc.com>2005-08-09 03:44:48 +0000
commitede6f592b3d2b109e8c59c07c00f11b248eaeda5 (patch)
tree5e89e38fd9193b9c486cc936a9488702f4f8111e /cppe/demo/IceE/minimal/WinCEClient.cpp
parentFixed a few build errors (diff)
downloadice-ede6f592b3d2b109e8c59c07c00f11b248eaeda5.tar.bz2
ice-ede6f592b3d2b109e8c59c07c00f11b248eaeda5.tar.xz
ice-ede6f592b3d2b109e8c59c07c00f11b248eaeda5.zip
cleanup. CE demos now use config.txt
Diffstat (limited to 'cppe/demo/IceE/minimal/WinCEClient.cpp')
-rw-r--r--cppe/demo/IceE/minimal/WinCEClient.cpp25
1 files changed, 21 insertions, 4 deletions
diff --git a/cppe/demo/IceE/minimal/WinCEClient.cpp b/cppe/demo/IceE/minimal/WinCEClient.cpp
index e7ba1e21b13..7d8674e2cbc 100644
--- a/cppe/demo/IceE/minimal/WinCEClient.cpp
+++ b/cppe/demo/IceE/minimal/WinCEClient.cpp
@@ -24,12 +24,29 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmd
try
{
- communicator = Ice::initialize(__argc, __argv);
+ Ice::PropertiesPtr properties = Ice::createProperties();
+
+ //
+ // Set a default value for "Hello.Proxy" so that the demo will
+ // run without a configuration file.
+ //
+ properties->setProperty("Hello.Proxy", "hello:tcp -p 10000");
+
//
- // We use a fixed string so that the demo will run without a
- // configuration file.
+ // Now, load the configuration file if present. Under WinCE we
+ // use "config.txt" since it can be edited with pocket word.
//
- HelloPrx hello = HelloPrx::checkedCast(communicator->stringToProxy("hello:tcp -p 10000"));
+ try
+ {
+ properties->load("config.txt");
+ }
+ catch(const Ice::FileException&)
+ {
+ }
+
+ communicator = Ice::initializeWithProperties(__argc, __argv, properties);
+
+ HelloPrx hello = HelloPrx::checkedCast(communicator->stringToProxy(properties->getProperty("Hello.Proxy")));
if(!hello)
{
MessageBox(NULL, L"invalid proxy", L"Minimal Client", MB_ICONEXCLAMATION | MB_OK);