From 7ec2da4c782dce0486cb763b5f23c2b73636054c Mon Sep 17 00:00:00 2001 From: schmidt Date: Tue, 21 Dec 1999 18:20:32 +0000 Subject: ChangeLogTag:Tue Dec 21 08:02:43 1999 Douglas C. Schmidt --- TAO/utils/NamingViewer/BindDialog.cpp | 103 ++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 TAO/utils/NamingViewer/BindDialog.cpp (limited to 'TAO/utils/NamingViewer/BindDialog.cpp') 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(); +} -- cgit v1.2.1