diff options
author | Matthew Newhook <matthew@zeroc.com> | 2005-09-12 02:46:32 +0000 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2005-09-12 02:46:32 +0000 |
commit | 759f7f34281a2c3d406ce93e52e63272a9d4beba (patch) | |
tree | 491339afc3ba74316d9d9019318836ffb6621ce8 /cpp/demo/Ice/MFC/client/HelloClient.cpp | |
parent | bug fix to the icepack hello demo. (diff) | |
download | ice-759f7f34281a2c3d406ce93e52e63272a9d4beba.tar.bz2 ice-759f7f34281a2c3d406ce93e52e63272a9d4beba.tar.xz ice-759f7f34281a2c3d406ce93e52e63272a9d4beba.zip |
http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=335
Diffstat (limited to 'cpp/demo/Ice/MFC/client/HelloClient.cpp')
-rw-r--r-- | cpp/demo/Ice/MFC/client/HelloClient.cpp | 145 |
1 files changed, 74 insertions, 71 deletions
diff --git a/cpp/demo/Ice/MFC/client/HelloClient.cpp b/cpp/demo/Ice/MFC/client/HelloClient.cpp index 0ed631775c3..6d68c7122d9 100644 --- a/cpp/demo/Ice/MFC/client/HelloClient.cpp +++ b/cpp/demo/Ice/MFC/client/HelloClient.cpp @@ -7,74 +7,77 @@ // // ********************************************************************** -
-#include "stdafx.h"
-#include "HelloClient.h"
-#include "HelloClientDlg.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#endif
-
-BEGIN_MESSAGE_MAP(CHelloClientApp, CWinApp)
- ON_COMMAND(ID_HELP, CWinApp::OnHelp)
-END_MESSAGE_MAP()
-
-CHelloClientApp::CHelloClientApp()
-{
- // Place all significant initialization in InitInstance
-}
-
-// The one and only CHelloClientApp object
-
-CHelloClientApp theApp;
-
-BOOL
-CHelloClientApp::InitInstance()
-{
- // InitCommonControls() is required on Windows XP if an application
- // manifest specifies use of ComCtl32.dll version 6 or later to enable
- // visual styles. Otherwise, any window creation will fail.
- InitCommonControls();
-
- CWinApp::InitInstance();
-
- //
- // Create a communicator.
- //
- Ice::CommunicatorPtr communicator;
- try
- {
- int argc = 0;
- Ice::PropertiesPtr properties = Ice::createProperties();
- properties->load("config");
- communicator = Ice::initializeWithProperties(argc, 0, properties);
- }
- catch(const IceUtil::Exception& ex)
- {
- std::ostringstream ostr;
- ostr << ex;
- std::string s = ostr.str();
- AfxMessageBox(CString(s.c_str()), MB_OK|MB_ICONEXCLAMATION);
- return FALSE;
- }
-
- CHelloClientDlg dlg(communicator);
- m_pMainWnd = &dlg;
- dlg.DoModal();
-
- //
- // Clean up.
- //
- try
- {
- communicator->destroy();
- }
- catch(const IceUtil::Exception&)
- {
- }
-
- // Since the dialog has been closed, return FALSE so that we exit the
- // application, rather than start the application's message pump.
- return FALSE;
-}
+ +#include "stdafx.h" +#include "HelloClient.h" +#include "HelloClientDlg.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#endif + +BEGIN_MESSAGE_MAP(CHelloClientApp, CWinApp) + ON_COMMAND(ID_HELP, CWinApp::OnHelp) +END_MESSAGE_MAP() + +using namespace std; + + +CHelloClientApp::CHelloClientApp() +{ + // Place all significant initialization in InitInstance +} + +// The one and only CHelloClientApp object + +CHelloClientApp theApp; + +BOOL +CHelloClientApp::InitInstance() +{ + // InitCommonControls() is required on Windows XP if an application + // manifest specifies use of ComCtl32.dll version 6 or later to enable + // visual styles. Otherwise, any window creation will fail. + InitCommonControls(); + + CWinApp::InitInstance(); + + // + // Create a communicator. + // + Ice::CommunicatorPtr communicator; + try + { + int argc = 0; + Ice::PropertiesPtr properties = Ice::createProperties(); + properties->load("config"); + communicator = Ice::initializeWithProperties(argc, 0, properties); + } + catch(const IceUtil::Exception& ex) + { + ostringstream ostr; + ostr << ex; + string s = ostr.str(); + AfxMessageBox(CString(s.c_str()), MB_OK|MB_ICONEXCLAMATION); + return FALSE; + } + + CHelloClientDlg dlg(communicator); + m_pMainWnd = &dlg; + dlg.DoModal(); + + // + // Clean up. + // + try + { + communicator->destroy(); + } + catch(const IceUtil::Exception&) + { + } + + // Since the dialog has been closed, return FALSE so that we exit the + // application, rather than start the application's message pump. + return FALSE; +} |