Use a variable on the stack to not have a temporary in the call
[ACE_TAO.git] / TAO / utils / NamingViewer / BindNewContext.cpp
blobba797c7ae883eb7cbf87e534416c400970bffa5c
1 // BindNewContext.cpp : implementation file
3 #include "stdafx.h"
4 #include "NamingViewer.h"
5 #include "BindNewContext.h"
7 #ifdef _DEBUG
8 #define new DEBUG_NEW
9 #undef THIS_FILE
10 static char THIS_FILE[] = __FILE__;
11 #endif
13 /////////////////////////////////////////////////////////////////////////////
14 // CBindNewContext dialog
17 CBindNewContext::CBindNewContext(CWnd* pParent /*=NULL*/)
18 : CDialog(CBindNewContext::IDD, pParent)
20 //{{AFX_DATA_INIT(CBindNewContext)
21 m_ID = _T("");
22 m_Kind = _T("");
23 //}}AFX_DATA_INIT
27 void CBindNewContext::DoDataExchange(CDataExchange* pDX)
29 CDialog::DoDataExchange(pDX);
30 //{{AFX_DATA_MAP(CBindNewContext)
31 DDX_Text(pDX, IDC_ID, m_ID);
32 DDX_Text(pDX, IDC_KIND, m_Kind);
33 //}}AFX_DATA_MAP
37 BEGIN_MESSAGE_MAP(CBindNewContext, CDialog)
38 //{{AFX_MSG_MAP(CBindNewContext)
39 //}}AFX_MSG_MAP
40 END_MESSAGE_MAP()
42 /////////////////////////////////////////////////////////////////////////////
43 // CBindNewContext message handlers
45 void CBindNewContext::OnOK()
47 // TODO: Add extra validation here
48 UpdateData();
49 m_Name.length(1);
50 m_Name[0].id = CORBA::string_dup(ACE_TEXT_ALWAYS_CHAR (m_ID));
51 m_Name[0].kind = CORBA::string_dup(ACE_TEXT_ALWAYS_CHAR (m_Kind));
52 CDialog::OnOK();