diff options
Diffstat (limited to 'cppe/demo/IceE/chat/ChatClientDlg.cpp')
-rw-r--r-- | cppe/demo/IceE/chat/ChatClientDlg.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/cppe/demo/IceE/chat/ChatClientDlg.cpp b/cppe/demo/IceE/chat/ChatClientDlg.cpp index d80e48878ea..1116e58c35f 100644 --- a/cppe/demo/IceE/chat/ChatClientDlg.cpp +++ b/cppe/demo/IceE/chat/ChatClientDlg.cpp @@ -56,12 +56,6 @@ CChatClientDlg::CChatClientDlg(const Ice::CommunicatorPtr& communicator, const L _port("10005") { _hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); - - // - // Create the OA. - // - _adapter = _communicator->createObjectAdapterWithEndpoints("Chat.Client", ""); - _adapter->activate(); } CChatClientDlg::~CChatClientDlg() @@ -349,10 +343,12 @@ CChatClientDlg::OnLogin() // _chat = ChatSessionPrx::uncheckedCast(_router->createSession(user, password)->ice_router(_router)); - // - // Add the new router to the object adapter. - // - _adapter->addRouter(_router); + + // + // Create the OA. + // + _adapter = _communicator->createObjectAdapterWithRouter("Chat.Client", _router); + _adapter->activate(); // // Create the callback object. This must have the @@ -416,7 +412,7 @@ CChatClientDlg::OnLogin() AfxMessageBox(CString(ex.toString().c_str()), MB_OK|MB_ICONEXCLAMATION); } - _adapter->removeRouter(_router); + _adapter->destroy(); _router = 0; } |