2 #include "NamingViewer.h"
3 #include "BindDialog.h"
4 #include "ViewIORDialog.h"
9 static char THIS_FILE
[] = __FILE__
;
12 /////////////////////////////////////////////////////////////////////////////
16 CBindDialog::CBindDialog(bool Context
, CORBA::ORB_ptr pORB
, CWnd
* pParent
/*=NULL*/)
17 : CDialog(CBindDialog::IDD
, pParent
)
19 //{{AFX_DATA_INIT(CBindDialog)
29 void CBindDialog::DoDataExchange(CDataExchange
* pDX
)
31 CDialog::DoDataExchange(pDX
);
32 //{{AFX_DATA_MAP(CBindDialog)
33 DDX_Text(pDX
, IDC_IOR
, m_IOR
);
34 DDX_Text(pDX
, IDC_ID
, m_ID
);
35 DDX_Text(pDX
, IDC_KIND
, m_Kind
);
40 BEGIN_MESSAGE_MAP(CBindDialog
, CDialog
)
41 //{{AFX_MSG_MAP(CBindDialog)
42 ON_BN_CLICKED(IDC_VIEWIOR
, OnViewior
)
46 /////////////////////////////////////////////////////////////////////////////
47 // CBindDialog message handlers
49 void CBindDialog::OnViewior()
51 // TODO: Add your control notification handler code here
55 m_Object
= m_pORB
->string_to_object(m_IOR
);
57 catch(CORBA::Exception
& ex
)
59 MessageBox(ACE_TEXT_CHAR_TO_TCHAR (ex
._rep_id()), ACE_TEXT ("CORBA::Exception"));
62 ViewIORDialog
Dialog(m_pORB
, m_Object
);
66 BOOL
CBindDialog::OnInitDialog()
68 CDialog::OnInitDialog();
70 // TODO: Add extra initialization here
73 SetWindowText(ACE_TEXT ("Bind Context"));
77 SetWindowText(ACE_TEXT ("Bind Object"));
79 return TRUE
; // return TRUE unless you set the focus to a control
80 // EXCEPTION: OCX Property Pages should return FALSE
83 void CBindDialog::OnOK()
85 // TODO: Add extra validation here
88 m_Name
[0].id
= CORBA::string_dup(ACE_TEXT_ALWAYS_CHAR (m_ID
));
89 m_Name
[0].kind
= CORBA::string_dup(ACE_TEXT_ALWAYS_CHAR (m_Kind
));
92 m_Object
= m_pORB
->string_to_object(m_IOR
);
94 catch(CORBA::Exception
& ex
)
96 MessageBox(ACE_TEXT_CHAR_TO_TCHAR (ex
._rep_id()), ACE_TEXT ("Invalid IOR"));