1 // **********************************************************************
3 // Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
5 // This copy of Ice is licensed to you under the terms described in the
6 // ICE_LICENSE file included in this distribution.
8 // **********************************************************************
11 #include "PatchClient.h"
12 #include "PatchClientDlg.h"
18 BEGIN_MESSAGE_MAP(CPatchClientApp
, CWinApp
)
19 ON_COMMAND(ID_HELP
, CWinApp::OnHelp
)
24 CPatchClientApp::CPatchClientApp()
26 // Place all significant initialization in InitInstance
29 // The one and only CPatchClientApp object
31 CPatchClientApp theApp
;
34 CPatchClientApp::InitInstance()
36 // InitCommonControls() is required on Windows XP if an application
37 // manifest specifies use of ComCtl32.dll version 6 or later to enable
38 // visual styles. Otherwise, any window creation will fail.
41 CWinApp::InitInstance();
44 // Create a communicator.
46 Ice::CommunicatorPtr communicator
;
50 for(int i
= 0; i
< __argc
; ++i
)
52 args
.push_back(IceUtil::wstringToString(__wargv
[i
]));
54 communicator
= Ice::initialize(args
);
56 catch(const IceUtil::Exception
& ex
)
60 string s
= ostr
.str();
61 AfxMessageBox(CString(s
.c_str()), MB_OK
|MB_ICONEXCLAMATION
);
65 Ice::PropertiesPtr properties
= communicator
->getProperties();
66 if(properties
->getProperty("IcePatch2.Endpoints").empty())
68 properties
->setProperty("IcePatch2.Endpoints", "tcp -h 127.0.0.1 -p 10000");
71 CPatchDlg
dlg(communicator
);
80 communicator
->destroy();
82 catch(const IceUtil::Exception
&)
86 // Since the dialog has been closed, return FALSE so that we exit the
87 // application, rather than start the application's message pump.