diff options
| author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1999-12-21 18:20:32 +0000 |
|---|---|---|
| committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1999-12-21 18:20:32 +0000 |
| commit | 7ec2da4c782dce0486cb763b5f23c2b73636054c (patch) | |
| tree | f0de331ba9d12a77ac3921c9b59e332f215a38ac /TAO/utils/NamingViewer/BindDialog.cpp | |
| parent | 050b3c596d140de0c3236ce7cae927a5864c969b (diff) | |
| download | ATCD-7ec2da4c782dce0486cb763b5f23c2b73636054c.tar.gz | |
ChangeLogTag:Tue Dec 21 08:02:43 1999 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
Diffstat (limited to 'TAO/utils/NamingViewer/BindDialog.cpp')
| -rw-r--r-- | TAO/utils/NamingViewer/BindDialog.cpp | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/TAO/utils/NamingViewer/BindDialog.cpp b/TAO/utils/NamingViewer/BindDialog.cpp new file mode 100644 index 00000000000..e48f9cc3624 --- /dev/null +++ b/TAO/utils/NamingViewer/BindDialog.cpp @@ -0,0 +1,103 @@ +// $Id$ +// BindDialog.cpp : implementation file + +#include "stdafx.h" +#include "NamingViewer.h" +#include "BindDialog.h" +#include "ViewIORDialog.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CBindDialog dialog + + +CBindDialog::CBindDialog(bool Context, CORBA::ORB_ptr pORB, CWnd* pParent /*=NULL*/) + : CDialog(CBindDialog::IDD, pParent) +{ + //{{AFX_DATA_INIT(CBindDialog) + m_IOR = _T(""); + m_ID = _T(""); + m_Kind = _T(""); + //}}AFX_DATA_INIT + m_pORB = pORB; + m_Context = Context; +} + + +void CBindDialog::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CBindDialog) + DDX_Text(pDX, IDC_IOR, m_IOR); + DDX_Text(pDX, IDC_ID, m_ID); + DDX_Text(pDX, IDC_KIND, m_Kind); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CBindDialog, CDialog) + //{{AFX_MSG_MAP(CBindDialog) + ON_BN_CLICKED(IDC_VIEWIOR, OnViewior) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CBindDialog message handlers + +void CBindDialog::OnViewior() +{ + // TODO: Add your control notification handler code here + try + { + UpdateData(); + m_Object = m_pORB->string_to_object(m_IOR); + } + catch(CORBA::Exception& ex) + { + MessageBox(ex._id(), "CORBA::Exception"); + return; + } + ViewIORDialog Dialog(m_pORB, m_Object); + Dialog.DoModal(); +} + +BOOL CBindDialog::OnInitDialog() +{ + CDialog::OnInitDialog(); + + // TODO: Add extra initialization here + if(m_Context) + { + SetWindowText("Bind Context"); + } + else + { + SetWindowText("Bind Object"); + } + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE +} + +void CBindDialog::OnOK() +{ + // TODO: Add extra validation here + UpdateData(); + m_Name.length(1); + m_Name[0].id = CORBA::string_dup(m_ID); + m_Name[0].kind = CORBA::string_dup(m_Kind); + try + { + m_Object = m_pORB->string_to_object(m_IOR); + } + catch(CORBA::Exception& ex) + { + MessageBox(ex._id(), "Invalid IOR"); + return; + } + CDialog::OnOK(); +} |
