diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2005-02-11 14:44:05 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2005-02-11 14:44:05 +0000 |
commit | 687f681ea53084da4af34aff670dad6badc3ded7 (patch) | |
tree | 69f59e90ba81c43cfd149c42c5c4ae691e57ec25 | |
parent | 53be017f219690a7ab12215c270cc1014934f24f (diff) | |
download | ATCD-687f681ea53084da4af34aff670dad6badc3ded7.tar.gz |
ChangeLogTag: Fri Feb 11 08:42:25 2005 Chad Elliott <elliott_c@ociweb.com>
23 files changed, 231 insertions, 140 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 540e24eacd9..a500fa7bb47 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,31 @@ +Fri Feb 11 08:42:25 2005 Chad Elliott <elliott_c@ociweb.com> + + * orbsvcs/TAO_Service/TAO_Service.cpp: + * orbsvcs/orbsvcs/Naming/Flat_File_Persistence.cpp: + * orbsvcs/orbsvcs/Naming/Storable_Naming_Context.cpp: + * tao/CDR.cpp: + * tao/Connector_Registry.cpp: + * tao/ORB_Core.cpp: + * tao/UTF16_BOM_Factory.cpp: + * utils/NamingViewer/BindDialog.cpp: + * utils/NamingViewer/BindNewContext.cpp: + * utils/NamingViewer/NamingTreeCtrl.cpp: + * utils/NamingViewer/NamingViewer.mpc: + * utils/NamingViewer/NamingViewer.cpp: + * utils/NamingViewer/NamingViewerDlg.h: + * utils/NamingViewer/NamingViewerDlg.cpp: + * utils/NamingViewer/SelectNSDialog.cpp: + * utils/NamingViewer/ViewIORDialog.cpp: + * utils/catior/catior.cpp: + * utils/catior/catior.mpc: + * utils/nslist/nsadd.cpp: + * utils/nslist/nsdel.cpp: + * utils/nslist/nslist.cpp: + * utils/nslist/nslist.mpc: + + Added better support for EVC 4. It is not complete, but now the + CosNaming library (among other things) can be built. + Fri Feb 11 07:29:34 2005 Ciju John <john_c@ociweb.com> * orbsvcs/tests/Notify/Reconnecting/run_test.pl: diff --git a/TAO/orbsvcs/TAO_Service/TAO_Service.cpp b/TAO/orbsvcs/TAO_Service/TAO_Service.cpp index d015a33e1c9..b711c0e363b 100644 --- a/TAO/orbsvcs/TAO_Service/TAO_Service.cpp +++ b/TAO/orbsvcs/TAO_Service/TAO_Service.cpp @@ -24,7 +24,7 @@ #include "ace/Log_Msg.h" #include "ace/Signal.h" #include "ace/Time_Value.h" - +#include "ace/Argv_Type_Converter.h" ACE_RCSID (TAO_Service, TAO_Service, @@ -37,14 +37,16 @@ extern "C" void handler (int) } int -main (int argc, char *argv[]) +ACE_TMAIN (int argc, ACE_TCHAR *argv[]) { ACE_DECLARE_NEW_CORBA_ENV; ACE_TRY { + ACE_Argv_Type_Converter argcon (argc, argv); // ORB initialization boiler plate... CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); + CORBA::ORB_init (argcon.get_argc (), argcon.get_ASCII_argv (), + "" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; ACE_Sig_Action sa ((ACE_SignalHandler) handler, SIGHUP); diff --git a/TAO/orbsvcs/orbsvcs/Naming/Flat_File_Persistence.cpp b/TAO/orbsvcs/orbsvcs/Naming/Flat_File_Persistence.cpp index d9fa7b9369f..fb71c6f1a4c 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Flat_File_Persistence.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/Flat_File_Persistence.cpp @@ -91,7 +91,7 @@ TAO_NS_FlatFileStream::close() ACE_OS::flock_destroy (&filelock_, 0); #endif ACE_OS::fclose (fl_); // even though flock_destroy closes the handle - // we still need to destroy the FILE* + // we still need to destroy the FILE* fl_ = 0; return 0; @@ -181,15 +181,15 @@ TAO_NS_FlatFileStream::operator <<( ACE_OS::fprintf(this->fl_, "%d\n", type); ACE_CString id = record.id(); - ACE_OS::fprintf(this->fl_, ACE_TEXT_ALWAYS_CHAR(ACE_SIZE_T_FORMAT_SPECIFIER "\n%s\n"), + ACE_OS::fprintf(this->fl_, ACE_SIZE_T_FORMAT_SPECIFIER ACE_LIB_TEXT("\n%s\n"), id.length(), id.c_str()); ACE_CString kind = record.kind(); - ACE_OS::fprintf(this->fl_, ACE_TEXT_ALWAYS_CHAR(ACE_SIZE_T_FORMAT_SPECIFIER "\n%s\n"), + ACE_OS::fprintf(this->fl_, ACE_SIZE_T_FORMAT_SPECIFIER ACE_LIB_TEXT ("\n%s\n"), kind.length(), kind.c_str()); ACE_CString ref = record.ref(); - ACE_OS::fprintf(this->fl_, ACE_TEXT_ALWAYS_CHAR(ACE_SIZE_T_FORMAT_SPECIFIER "\n%s\n"), + ACE_OS::fprintf(this->fl_, ACE_SIZE_T_FORMAT_SPECIFIER ACE_LIB_TEXT ("\n%s\n"), ref.length(), ref.c_str()); ACE_OS::fflush(this->fl_); @@ -211,7 +211,7 @@ TAO_NS_FlatFileStream::operator >>( size_t bufSize = 0; //id - fscanf(fl_, ACE_SIZE_T_FORMAT_SPECIFIER "\n", &bufSize); + fscanf(fl_, ACE_TEXT_ALWAYS_CHAR (ACE_SIZE_T_FORMAT_SPECIFIER ACE_LIB_TEXT ("\n")), &bufSize); char *id = new char[bufSize+1]; //char *id; //ACE_NEW_RETURN (id, char[bufSize+1], 1); @@ -221,7 +221,7 @@ TAO_NS_FlatFileStream::operator >>( delete [] id; //kind - fscanf(fl_, ACE_SIZE_T_FORMAT_SPECIFIER "\n", &bufSize); + fscanf(fl_, ACE_TEXT_ALWAYS_CHAR (ACE_SIZE_T_FORMAT_SPECIFIER ACE_LIB_TEXT ("\n")), &bufSize); char *kind = new char[bufSize+1]; //char *kind; //ACE_NEW (kind, char[bufSize+1]); @@ -232,7 +232,7 @@ TAO_NS_FlatFileStream::operator >>( delete [] kind; //ref - fscanf(fl_, ACE_SIZE_T_FORMAT_SPECIFIER "\n", &bufSize); + fscanf(fl_, ACE_TEXT_ALWAYS_CHAR (ACE_SIZE_T_FORMAT_SPECIFIER ACE_LIB_TEXT ("\n")), &bufSize); char *ref = new char[bufSize+1]; //char *ref; //ACE_NEW(ref, char[bufSize+1]); @@ -275,13 +275,13 @@ TAO_NS_FlatFileStream::operator >>( TAO_Storable_Base *TAO_NS_FlatFileFactory::create_stream( const ACE_CString & file, - const char * mode) + const ACE_TCHAR * mode) { ACE_TRACE("TAO_NS_FlatFileFactory::create_stream"); TAO_Storable_Base *stream = 0; ACE_NEW_RETURN (stream, - TAO_NS_FlatFileStream(file, ACE_TEXT_ALWAYS_CHAR(mode)), + TAO_NS_FlatFileStream(file, ACE_TEXT_ALWAYS_CHAR (mode)), 0); return stream; } diff --git a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.cpp b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.cpp index 688e13d51cd..8e9ff4254ae 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.cpp @@ -546,7 +546,7 @@ TAO_Storable_Naming_Context::~TAO_Storable_Naming_Context (void) // Now delete the file ACE_Auto_Ptr<TAO_Storable_Base> fl ( - this->factory_->create_stream(ACE_TEXT_ALWAYS_CHAR(file_name.c_str()), + this->factory_->create_stream(file_name.c_str(), ACE_TEXT("r")) ); if (fl.get()) diff --git a/TAO/tao/CDR.cpp b/TAO/tao/CDR.cpp index 3c62df4c3e5..89cbe621255 100644 --- a/TAO/tao/CDR.cpp +++ b/TAO/tao/CDR.cpp @@ -142,9 +142,11 @@ TAO_OutputCDR::throw_stub_exception (int error_num ACE_ENV_ARG_DECL) case EINVAL : // wchar from a GIOP 1.0 ACE_THROW (CORBA::MARSHAL (CORBA::OMGVMCID | 5, CORBA::COMPLETED_NO)); ACE_NOTREACHED(break); +#if (ERANGE != EINVAL) case ERANGE : // untranslatable character ACE_THROW (CORBA::DATA_CONVERSION (CORBA::OMGVMCID | 1, CORBA::COMPLETED_NO)); ACE_NOTREACHED(break); +#endif case EACCES : // wchar but no codeset ACE_THROW(CORBA::INV_OBJREF (CORBA::OMGVMCID | 2, CORBA::COMPLETED_NO)); ACE_NOTREACHED(break); @@ -168,9 +170,11 @@ TAO_OutputCDR::throw_skel_exception (int error_num ACE_ENV_ARG_DECL) ACE_THROW (CORBA::BAD_PARAM(CORBA::OMGVMCID | 23, CORBA::COMPLETED_YES)); ACE_NOTREACHED(break); +#if (ERANGE != EINVAL) case ERANGE : // untranslatable character ACE_THROW (CORBA::DATA_CONVERSION(CORBA::OMGVMCID | 1, CORBA::COMPLETED_YES)); ACE_NOTREACHED(break); +#endif default : ACE_THROW (CORBA::MARSHAL(0, CORBA::COMPLETED_YES)); @@ -214,9 +218,11 @@ TAO_InputCDR::throw_stub_exception (int error_num ACE_ENV_ARG_DECL) case EINVAL : // wchar from a GIOP 1.0 ACE_THROW (CORBA::MARSHAL (CORBA::OMGVMCID | 6, CORBA::COMPLETED_YES)); ACE_NOTREACHED(break); +#if (ERANGE != EINVAL) case ERANGE : // untranslatable character ACE_THROW (CORBA::DATA_CONVERSION (CORBA::OMGVMCID | 1, CORBA::COMPLETED_YES)); ACE_NOTREACHED(break); +#endif case EACCES : // wchar but no codeset ACE_THROW (CORBA::INV_OBJREF (CORBA::OMGVMCID | 2, CORBA::COMPLETED_YES)); ACE_NOTREACHED(break); @@ -240,9 +246,11 @@ TAO_InputCDR::throw_skel_exception (int error_num ACE_ENV_ARG_DECL) ACE_THROW (CORBA::BAD_PARAM(CORBA::OMGVMCID | 23, CORBA::COMPLETED_NO)); ACE_NOTREACHED(break); +#if (ERANGE != EINVAL) case ERANGE : // untranslatable character ACE_THROW (CORBA::DATA_CONVERSION(CORBA::OMGVMCID | 1, CORBA::COMPLETED_NO)); ACE_NOTREACHED(break); +#endif default : ACE_THROW (CORBA::MARSHAL()); diff --git a/TAO/tao/Connector_Registry.cpp b/TAO/tao/Connector_Registry.cpp index 587bcd1a72b..9c936f6da6c 100644 --- a/TAO/tao/Connector_Registry.cpp +++ b/TAO/tao/Connector_Registry.cpp @@ -195,8 +195,8 @@ TAO_Connector_Registry::create_profile (TAO_InputCDR &cdr) if (TAO_debug_level > 0) { ACE_DEBUG ((LM_WARNING, - ACE_LIB_TEXT ("TAO (%P|%t) - TAO_Connector_Registry" - "::create_profile: ") + ACE_LIB_TEXT ("TAO (%P|%t) - TAO_Connector_Registry") + ACE_LIB_TEXT ("::create_profile: ") ACE_LIB_TEXT ("WARNING: extracting object from ") ACE_LIB_TEXT ("default ORB_Core\n"))); } diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp index 3b9cf416b4e..8b4a5d76f7f 100644 --- a/TAO/tao/ORB_Core.cpp +++ b/TAO/tao/ORB_Core.cpp @@ -530,7 +530,7 @@ TAO_ORB_Core::init (int &argc, char *argv[] ACE_ENV_ARG_DECL) (ACE_TEXT("-ORBPreferredInterfaces")))) { if (this->orb_params ()->preferred_interfaces ( - current_arg) == false) + ACE_TEXT_ALWAYS_CHAR (current_arg)) == false) ACE_THROW_RETURN (CORBA::INTERNAL ( CORBA::SystemException::_tao_minor_code ( TAO_ORB_CORE_INIT_LOCATION_CODE, @@ -758,7 +758,7 @@ TAO_ORB_Core::init (int &argc, char *argv[] ACE_ENV_ARG_DECL) // // All endpoint strings should be of the above form(s). - this->set_endpoint_helper (ACE_TEXT_ALWAYS_CHAR (TAO_DEFAULT_LANE), + this->set_endpoint_helper (TAO_DEFAULT_LANE, ACE_TEXT_ALWAYS_CHAR (current_arg) ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (-1); @@ -773,7 +773,7 @@ TAO_ORB_Core::init (int &argc, char *argv[] ACE_ENV_ARG_DECL) // now, I (Priyanka) am leaving so that both options can be // used. - this->set_endpoint_helper (ACE_TEXT_ALWAYS_CHAR (TAO_DEFAULT_LANE), + this->set_endpoint_helper (TAO_DEFAULT_LANE, ACE_TEXT_ALWAYS_CHAR (current_arg) ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (-1); diff --git a/TAO/tao/UTF16_BOM_Factory.cpp b/TAO/tao/UTF16_BOM_Factory.cpp index 6f5d5494129..9bf0443682a 100644 --- a/TAO/tao/UTF16_BOM_Factory.cpp +++ b/TAO/tao/UTF16_BOM_Factory.cpp @@ -84,7 +84,7 @@ int UTF16_BOM_Factory::parse_one_arg (int argc, ACE_TCHAR *argv[]) { int consumed = 0; - if ((argc > 0) && (ACE_OS::strcasecmp (argv[0], "-forcebe") == 0)) + if ((argc > 0) && (ACE_OS::strcasecmp (argv[0], ACE_TEXT ("-forcebe")) == 0)) { this->forceBE_ = true; consumed = 1; diff --git a/TAO/utils/NamingViewer/BindDialog.cpp b/TAO/utils/NamingViewer/BindDialog.cpp index b12102c7bde..a7a0c2b7cdb 100644 --- a/TAO/utils/NamingViewer/BindDialog.cpp +++ b/TAO/utils/NamingViewer/BindDialog.cpp @@ -48,54 +48,54 @@ END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CBindDialog message handlers -void CBindDialog::OnViewior() +void CBindDialog::OnViewior() { // TODO: Add your control notification handler code here try { UpdateData(); - m_Object = m_pORB->string_to_object(m_IOR); + m_Object = m_pORB->string_to_object(ACE_TEXT_ALWAYS_CHAR (m_IOR)); } catch(CORBA::Exception& ex) { - MessageBox(ex._rep_id(), "CORBA::Exception"); + MessageBox(ACE_TEXT_CHAR_TO_TCHAR (ex._rep_id()), ACE_TEXT ("CORBA::Exception")); return; } ViewIORDialog Dialog(m_pORB, m_Object); Dialog.DoModal(); } -BOOL CBindDialog::OnInitDialog() +BOOL CBindDialog::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here if(m_Context) { - SetWindowText("Bind Context"); + SetWindowText(ACE_TEXT ("Bind Context")); } else { - SetWindowText("Bind Object"); + SetWindowText(ACE_TEXT ("Bind Object")); } return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } -void CBindDialog::OnOK() +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); + m_Name[0].id = CORBA::string_dup(ACE_TEXT_ALWAYS_CHAR (m_ID)); + m_Name[0].kind = CORBA::string_dup(ACE_TEXT_ALWAYS_CHAR (m_Kind)); try { - m_Object = m_pORB->string_to_object(m_IOR); + m_Object = m_pORB->string_to_object(ACE_TEXT_ALWAYS_CHAR (m_IOR)); } catch(CORBA::Exception& ex) { - MessageBox(ex._rep_id(), "Invalid IOR"); + MessageBox(ACE_TEXT_CHAR_TO_TCHAR (ex._rep_id()), ACE_TEXT ("Invalid IOR")); return; } CDialog::OnOK(); diff --git a/TAO/utils/NamingViewer/BindNewContext.cpp b/TAO/utils/NamingViewer/BindNewContext.cpp index 66d7f942ca3..a846fa6cf3c 100644 --- a/TAO/utils/NamingViewer/BindNewContext.cpp +++ b/TAO/utils/NamingViewer/BindNewContext.cpp @@ -43,12 +43,12 @@ END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CBindNewContext message handlers -void CBindNewContext::OnOK() +void CBindNewContext::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); + m_Name[0].id = CORBA::string_dup(ACE_TEXT_ALWAYS_CHAR (m_ID)); + m_Name[0].kind = CORBA::string_dup(ACE_TEXT_ALWAYS_CHAR (m_Kind)); CDialog::OnOK(); } diff --git a/TAO/utils/NamingViewer/NamingTreeCtrl.cpp b/TAO/utils/NamingViewer/NamingTreeCtrl.cpp index 8bdf87e1613..112d769ee01 100644 --- a/TAO/utils/NamingViewer/NamingTreeCtrl.cpp +++ b/TAO/utils/NamingViewer/NamingTreeCtrl.cpp @@ -48,13 +48,13 @@ END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CNamingTreeCtrl message handlers -void CNamingTreeCtrl::OnRButtonDown (UINT nFlags, CPoint point) +void CNamingTreeCtrl::OnRButtonDown (UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default // Special case here - this causes the entry to be selected when the // right button is the first to be hit. strange OnLButtonDown (nFlags, point); - + // Now find the item were hitting HTREEITEM hItem = HitTest(point); if(!hItem) @@ -70,21 +70,31 @@ void CNamingTreeCtrl::OnRButtonDown (UINT nFlags, CPoint point) // If this is not a context, show the object popup if(!pObject->IsContext()) { - if(!m_ObjectPopup.GetSubMenu(0)->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, Point.x, Point.y, this)) + if(!m_ObjectPopup.GetSubMenu(0)->TrackPopupMenu( +#if defined (TPM_RIGHTBUTTON) + TPM_RIGHTBUTTON | +#endif + TPM_LEFTALIGN, + Point.x, Point.y, this)) { TRACE0("TrackPopupMenu Failed"); } } else { - if(!m_ContextPopup.GetSubMenu(0)->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, Point.x, Point.y, this)) + if(!m_ContextPopup.GetSubMenu(0)->TrackPopupMenu( +#if defined (TPM_RIGHTBUTTON) + TPM_RIGHTBUTTON | +#endif + TPM_LEFTALIGN, + Point.x, Point.y, this)) { TRACE0("TrackPopupMenu Failed"); } } } -void CNamingTreeCtrl::OnContextPopupViewreference() +void CNamingTreeCtrl::OnContextPopupViewreference() { // TODO: Add your command handler code here ViewIORDialog Dialog(m_pORB, GetTreeObject()->Object()); @@ -117,7 +127,7 @@ void CNamingTreeCtrl::ClearChildren(HTREEITEM hItem) HTREEITEM hItem = GetRootItem(); if(hItem) { - + //CORBA::Object_var Object = (CORBA::Object_ptr)GetItemData(hItem); ClearChildren(hItem); delete GetTreeObject(hItem); @@ -151,20 +161,20 @@ void CNamingTreeCtrl::ListContext(HTREEITEM hItem) { return; } - + // List the contexts entries CosNaming::BindingList_var bl; CosNaming::BindingIterator_var bi; Context->list(LISTQUANTUM, bl, bi); ListBindingList(hItem, Context, bl); - + if(!CORBA::is_nil(bi)) { while(bl->length()) { CString Text; - Text.Format("This context contains more than %d entries, list the next %d?", LISTQUANTUM, LISTQUANTUM); - if(MessageBox(Text, "Question", MB_YESNO) == IDNO) + Text.Format(ACE_TEXT ("This context contains more than %d entries, list the next %d?"), LISTQUANTUM, LISTQUANTUM); + if(MessageBox(Text, ACE_TEXT ("Question"), MB_YESNO) == IDNO) { return; } @@ -176,11 +186,11 @@ void CNamingTreeCtrl::ListContext(HTREEITEM hItem) } catch(CORBA::Exception& ex) { - MessageBox(ex._rep_id(), "CORBA::Exception"); + MessageBox(ACE_TEXT_CHAR_TO_TCHAR (ex._rep_id()), ACE_TEXT ("CORBA::Exception")); } } -void CNamingTreeCtrl::OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult) +void CNamingTreeCtrl::OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult) { NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR; // TODO: Add your control notification handler code here @@ -193,7 +203,7 @@ void CNamingTreeCtrl::OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult) ListContext(pNMTreeView->itemNew.hItem); } -void CNamingTreeCtrl::OnContextPopupRefresh() +void CNamingTreeCtrl::OnContextPopupRefresh() { // TODO: Add your command handler code here HTREEITEM hItem = GetSelectedItem(); @@ -201,10 +211,11 @@ void CNamingTreeCtrl::OnContextPopupRefresh() ListContext(hItem); } -void CNamingTreeCtrl::OnContextPopupUnbind() +void CNamingTreeCtrl::OnContextPopupUnbind() { // TODO: Add your command handler code here - if(MessageBox("Are you sure you want to unbind this object?", "Confirm", MB_YESNO | MB_ICONEXCLAMATION) != IDYES) + if(MessageBox(ACE_TEXT ("Are you sure you want to unbind this object?"), + ACE_TEXT ("Confirm"), MB_YESNO | MB_ICONEXCLAMATION) != IDYES) { return; } @@ -226,7 +237,7 @@ void CNamingTreeCtrl::OnContextPopupUnbind() } catch(CORBA::Exception& ex) { - MessageBox(ex._rep_id(), "CORBA::Exception"); + MessageBox(ACE_TEXT_CHAR_TO_TCHAR (ex._rep_id()), ACE_TEXT ("CORBA::Exception")); } } @@ -235,7 +246,7 @@ void CNamingTreeCtrl::Resolve(CosNaming::NamingContext_ptr pRootContext) ClearChildren(); if(!CORBA::is_nil(pRootContext)) { - HTREEITEM hItem = InsertItem("Root"); + HTREEITEM hItem = InsertItem(ACE_TEXT ("Root")); CosNaming::Name Name; Name.length(1); Name[0].id = CORBA::string_dup("Root"); @@ -244,10 +255,11 @@ void CNamingTreeCtrl::Resolve(CosNaming::NamingContext_ptr pRootContext) } } -void CNamingTreeCtrl::OnContextPopupDestroy() +void CNamingTreeCtrl::OnContextPopupDestroy() { // TODO: Add your command handler code here - if(MessageBox("Are you sure you want to destroy this context?", "Confirm", MB_YESNO | MB_ICONEXCLAMATION) != IDYES) + if(MessageBox(ACE_TEXT ("Are you sure you want to destroy this context?"), + ACE_TEXT ("Confirm"), MB_YESNO | MB_ICONEXCLAMATION) != IDYES) { return; } @@ -274,11 +286,11 @@ void CNamingTreeCtrl::OnContextPopupDestroy() } catch(CORBA::Exception& ex) { - MessageBox(ex._rep_id(), "CORBA::Exception"); + MessageBox(ACE_TEXT_CHAR_TO_TCHAR (ex._rep_id()), ACE_TEXT ("CORBA::Exception")); } } -void CNamingTreeCtrl::OnContextPopupBindContext() +void CNamingTreeCtrl::OnContextPopupBindContext() { // TODO: Add your command handler code here CBindDialog Dialog(true, m_pORB); @@ -297,7 +309,7 @@ void CNamingTreeCtrl::OnContextPopupBindContext() CosNaming::NamingContext_var NewContext = CosNaming::NamingContext::_narrow(Dialog.GetObject()); if(CORBA::is_nil(NewContext)) { - AfxMessageBox("Object is not a CosNaming::NamingContext"); + AfxMessageBox(ACE_TEXT ("Object is not a CosNaming::NamingContext")); return; } Context->bind_context(Dialog.GetName(), NewContext); @@ -305,11 +317,11 @@ void CNamingTreeCtrl::OnContextPopupBindContext() } catch(CORBA::Exception& ex) { - MessageBox(ex._rep_id(), "CORBA::Exception"); + MessageBox(ACE_TEXT_CHAR_TO_TCHAR (ex._rep_id()), ACE_TEXT ("CORBA::Exception")); } } -void CNamingTreeCtrl::OnContextPopupBindobject() +void CNamingTreeCtrl::OnContextPopupBindobject() { // TODO: Add your command handler code here CBindDialog Dialog(false, m_pORB); @@ -331,11 +343,11 @@ void CNamingTreeCtrl::OnContextPopupBindobject() } catch(CORBA::Exception& ex) { - MessageBox(ex._rep_id(), "CORBA::Exception"); + MessageBox(ACE_TEXT_CHAR_TO_TCHAR (ex._rep_id()), ACE_TEXT ("CORBA::Exception")); } } -void CNamingTreeCtrl::OnDestroy() +void CNamingTreeCtrl::OnDestroy() { CTreeCtrl::OnDestroy(); @@ -345,7 +357,7 @@ void CNamingTreeCtrl::OnDestroy() } -void CNamingTreeCtrl::OnContextpopupBindnewcontext() +void CNamingTreeCtrl::OnContextpopupBindnewcontext() { // TODO: Add your command handler code here HTREEITEM hItem = GetSelectedItem(); @@ -369,11 +381,11 @@ void CNamingTreeCtrl::OnContextpopupBindnewcontext() } catch(CORBA::Exception& ex) { - MessageBox(ex._rep_id(), "CORBA::Exception"); + MessageBox(ACE_TEXT_CHAR_TO_TCHAR (ex._rep_id()), ACE_TEXT ("CORBA::Exception")); } } -void CNamingTreeCtrl::OnDblclk(NMHDR* pNMHDR, LRESULT* pResult) +void CNamingTreeCtrl::OnDblclk(NMHDR* pNMHDR, LRESULT* pResult) { // TODO: Add your control notification handler code here CNamingObject* pObject = GetTreeObject(); @@ -387,7 +399,7 @@ void CNamingTreeCtrl::OnDblclk(NMHDR* pNMHDR, LRESULT* pResult) *pResult = 0; } -void CNamingTreeCtrl::OnCopy() +void CNamingTreeCtrl::OnCopy() { // TODO: Add your command handler code here CNamingObject* pObject = GetTreeObject(); @@ -406,11 +418,11 @@ void CNamingTreeCtrl::OnCopy() } catch(CORBA::Exception& ex) { - MessageBox(ex._rep_id(), "CORBA::Exception"); + MessageBox(ACE_TEXT_CHAR_TO_TCHAR (ex._rep_id()), ACE_TEXT ("CORBA::Exception")); } } -LRESULT CNamingTreeCtrl::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) +LRESULT CNamingTreeCtrl::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) { // TODO: Add your specialized code here and/or call the base class if(message == WM_HOTKEY) @@ -423,10 +435,11 @@ LRESULT CNamingTreeCtrl::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) return CTreeCtrl::WindowProc(message, wParam, lParam); } -void CNamingTreeCtrl::OnObjectpopupUnbind() +void CNamingTreeCtrl::OnObjectpopupUnbind() { // TODO: Add your command handler code here - if(MessageBox("Are you sure you want to unbind this object?", "Confirm", MB_YESNO | MB_ICONEXCLAMATION) != IDYES) + if(MessageBox(ACE_TEXT ("Are you sure you want to unbind this object?"), + ACE_TEXT ("Confirm"), MB_YESNO | MB_ICONEXCLAMATION) != IDYES) { return; } @@ -448,11 +461,11 @@ void CNamingTreeCtrl::OnObjectpopupUnbind() } catch(CORBA::Exception& ex) { - MessageBox(ex._rep_id(), "CORBA::Exception"); + MessageBox(ACE_TEXT_CHAR_TO_TCHAR (ex._rep_id()), ACE_TEXT ("CORBA::Exception")); } } -void CNamingTreeCtrl::OnObjectpopupViewrefrence() +void CNamingTreeCtrl::OnObjectpopupViewrefrence() { // TODO: Add your command handler code here ViewIORDialog Dialog(m_pORB, GetTreeObject()->Object()); @@ -473,11 +486,11 @@ void CNamingTreeCtrl::ListBindingList(HTREEITEM hItem, CosNaming::NamingContext_ const char* pKind = (bl[i].binding_name[0]).kind; if(*pKind) { - Name.Format("%s | %s", (bl[i].binding_name[0]).id, pKind); + Name.Format(ACE_TEXT ("%s | %s"), (bl[i].binding_name[0]).id, pKind); } else { - Name.Format("%s", (bl[i].binding_name[0]).id); + Name.Format(ACE_TEXT ("%s"), (bl[i].binding_name[0]).id); } HTREEITEM hContext = InsertItem(Name, hItem); SetItemData(hContext, (DWORD)pNewObject); @@ -500,7 +513,7 @@ void CNamingTreeCtrl::ListBindingList(HTREEITEM hItem, CosNaming::NamingContext_ } catch(CORBA::Exception& ex) { - MessageBox(ex._rep_id(), "CORBA::Exception"); + MessageBox(ACE_TEXT_CHAR_TO_TCHAR (ex._rep_id()), ACE_TEXT ("CORBA::Exception")); } } diff --git a/TAO/utils/NamingViewer/NamingViewer.cpp b/TAO/utils/NamingViewer/NamingViewer.cpp index 5f26bb90065..2f86a0d3a4a 100644 --- a/TAO/utils/NamingViewer/NamingViewer.cpp +++ b/TAO/utils/NamingViewer/NamingViewer.cpp @@ -5,6 +5,7 @@ #include "NamingViewerDlg.h" #include "ace/ARGV.h" #include "ace/ACE.h" +#include "ace/Argv_Type_Converter.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -47,11 +48,13 @@ BOOL CNamingViewerApp::InitInstance() // of your final executable, you should remove from the following // the specific initialization routines you do not need. +#if !defined (_WIN32_WCE) #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif +#endif // Parse command line arguments so we can initialize ORB with them ACE_ARGV Argv(ACE_TEXT_CHAR_TO_TCHAR(m_lpCmdLine)); @@ -60,8 +63,9 @@ BOOL CNamingViewerApp::InitInstance() { int argc = Argv.argc(); - ACE_TCHAR** argv = Argv.argv(); - CORBA::ORB_var ORB = CORBA::ORB_init(argc, argv); + ACE_Argv_Type_Converter argcon (argc, Argv.argv ()); + CORBA::ORB_var ORB = CORBA::ORB_init(argcon.get_argc (), + argcon.get_ASCII_argv ()); CNamingViewerDlg dlg(ORB); m_pMainWnd = &dlg; int nResponse = dlg.DoModal(); diff --git a/TAO/utils/NamingViewer/NamingViewer.mpc b/TAO/utils/NamingViewer/NamingViewer.mpc index 372bff084c8..ac0d95cf323 100644 --- a/TAO/utils/NamingViewer/NamingViewer.mpc +++ b/TAO/utils/NamingViewer/NamingViewer.mpc @@ -3,6 +3,7 @@ project : namingexe, ace_mfc { exename = NamingViewer + requires += exceptions install = $(ACE_ROOT)/bin pch_header = StdAfx.h pch_source = StdAfx.cpp diff --git a/TAO/utils/NamingViewer/NamingViewerDlg.cpp b/TAO/utils/NamingViewer/NamingViewerDlg.cpp index fc741184c38..0e7520cf8db 100644 --- a/TAO/utils/NamingViewer/NamingViewerDlg.cpp +++ b/TAO/utils/NamingViewer/NamingViewerDlg.cpp @@ -13,6 +13,7 @@ static char THIS_FILE[] = __FILE__; #endif + ///////////////////////////////////////////////////////////////////////////// // CAboutDlg dialog used for App About @@ -91,7 +92,9 @@ BEGIN_MESSAGE_MAP(CNamingViewerDlg, CDialog) ON_BN_CLICKED(IDC_SELECT_NS, OnSelectNs) ON_WM_SIZE() //}}AFX_MSG_MAP +#if !defined (_WIN32_WCE) ON_WM_GETMINMAXINFO() +#endif END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// @@ -107,6 +110,7 @@ BOOL CNamingViewerDlg::OnInitDialog() ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); ASSERT(IDM_ABOUTBOX < 0xF000); +#if !defined (_WIN32_WCE) CMenu* pSysMenu = GetSystemMenu(FALSE); if (pSysMenu != NULL) { @@ -118,6 +122,7 @@ BOOL CNamingViewerDlg::OnInitDialog() pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); } } +#endif // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog @@ -175,8 +180,6 @@ void CNamingViewerDlg::OnPaint() { CPaintDC dc(this); // device context for painting - SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); - // Center icon in client rectangle int cxIcon = GetSystemMetrics(SM_CXICON); int cyIcon = GetSystemMetrics(SM_CYICON); @@ -206,7 +209,7 @@ void CNamingViewerDlg::Resolve() m_Tree.Resolve(m_RootContext); } -void CNamingViewerDlg::OnSelectNs() +void CNamingViewerDlg::OnSelectNs() { // TODO: Add your control notification handler code here CSelectNSDialog Dialog; @@ -216,7 +219,7 @@ void CNamingViewerDlg::OnSelectNs() } try { - CORBA::Object_var Object = m_pORB->string_to_object(Dialog.GetIOR()); + CORBA::Object_var Object = m_pORB->string_to_object(ACE_TEXT_ALWAYS_CHAR (Dialog.GetIOR())); m_RootContext = CosNaming::NamingContext::_narrow(Object); m_Server = Dialog.GetName(); UpdateData(FALSE); @@ -224,19 +227,19 @@ void CNamingViewerDlg::OnSelectNs() } catch(CORBA::Exception& ex) { - MessageBox(ex._rep_id(), "CORBA::Exception"); + MessageBox(ACE_TEXT_CHAR_TO_TCHAR (ex._rep_id()), ACE_TEXT ("CORBA::Exception")); } } -void CNamingViewerDlg::OnSize(UINT nType, int cx, int cy) +void CNamingViewerDlg::OnSize(UINT nType, int cx, int cy) { CDialog::OnSize(nType, cx, cy); // TODO: Add your message handler code here - + // Resize the tree control if(m_Tree.m_hWnd) { - CRect Size; + CRect Size; m_Tree.GetWindowRect(Size); ScreenToClient(Size); int Border = Size.left; @@ -246,6 +249,7 @@ void CNamingViewerDlg::OnSize(UINT nType, int cx, int cy) } } +#if !defined (_WIN32_WCE) void CNamingViewerDlg::OnGetMinMaxInfo( MINMAXINFO FAR* lpMMI ) { // Prevent the window from being resized too small @@ -259,3 +263,4 @@ void CNamingViewerDlg::OnGetMinMaxInfo( MINMAXINFO FAR* lpMMI ) lpMMI->ptMinTrackSize.y = 200; } } +#endif diff --git a/TAO/utils/NamingViewer/NamingViewerDlg.h b/TAO/utils/NamingViewer/NamingViewerDlg.h index fbda6676e4d..d11f272dc10 100644 --- a/TAO/utils/NamingViewer/NamingViewerDlg.h +++ b/TAO/utils/NamingViewer/NamingViewerDlg.h @@ -11,6 +11,7 @@ #include "orbsvcs/CosNamingC.h" #include "NamingTreeCtrl.h" + ///////////////////////////////////////////////////////////////////////////// // CNamingViewerDlg dialog @@ -46,9 +47,10 @@ protected: afx_msg void OnSelectNs(); afx_msg void OnSize(UINT nType, int cx, int cy); //}}AFX_MSG +#if !defined (_WIN32_WCE) afx_msg void OnGetMinMaxInfo( MINMAXINFO FAR* lpMMI ); +#endif DECLARE_MESSAGE_MAP() - void Resolve(); CORBA::ORB_ptr m_pORB; diff --git a/TAO/utils/NamingViewer/SelectNSDialog.cpp b/TAO/utils/NamingViewer/SelectNSDialog.cpp index 2556cfeff38..401816b527c 100644 --- a/TAO/utils/NamingViewer/SelectNSDialog.cpp +++ b/TAO/utils/NamingViewer/SelectNSDialog.cpp @@ -49,13 +49,13 @@ END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CSelectNSDialog message handlers -void CSelectNSDialog::OnOK() +void CSelectNSDialog::OnOK() { // TODO: Add extra validation here int index = m_Servers.GetCurSel(); if(index == LB_ERR) { - AfxMessageBox("You must select a server or cancel"); + AfxMessageBox(ACE_TEXT ("You must select a server or cancel")); return; } char* pIOR = (char*)m_Servers.GetItemData(index); @@ -64,7 +64,7 @@ void CSelectNSDialog::OnOK() CDialog::OnOK(); } -void CSelectNSDialog::OnAdd() +void CSelectNSDialog::OnAdd() { // TODO: Add your control notification handler code here CAddNameServerDlg Dialog; @@ -82,7 +82,7 @@ void CSelectNSDialog::OnAdd() } -void CSelectNSDialog::OnRemove() +void CSelectNSDialog::OnRemove() { // TODO: Add your control notification handler code here int index = m_Servers.GetCurSel(); @@ -98,7 +98,7 @@ void CSelectNSDialog::OnRemove() m_Servers.DeleteString(index); } -BOOL CSelectNSDialog::OnInitDialog() +BOOL CSelectNSDialog::OnInitDialog() { CDialog::OnInitDialog(); @@ -106,8 +106,8 @@ BOOL CSelectNSDialog::OnInitDialog() HKEY hKey = ACE_Configuration_Win32Registry::resolve_key(HKEY_LOCAL_MACHINE, ACE_TEXT("Software\\TAO\\NamingViewer\\Servers")); m_pConfig = new ACE_Configuration_Win32Registry(hKey); ACE_Configuration_Section_Key Section = m_pConfig->root_section();; - int index = 0; - ACE_TString name; + int index = 0; + ACE_TString name; ACE_Configuration::VALUETYPE type; while(m_pConfig->enumerate_values(Section, index, name, type) == 0) { @@ -126,7 +126,7 @@ BOOL CSelectNSDialog::OnInitDialog() // EXCEPTION: OCX Property Pages should return FALSE } -void CSelectNSDialog::OnDestroy() +void CSelectNSDialog::OnDestroy() { CDialog::OnDestroy(); diff --git a/TAO/utils/NamingViewer/ViewIORDialog.cpp b/TAO/utils/NamingViewer/ViewIORDialog.cpp index 240f4ad06fb..f7724f02d70 100644 --- a/TAO/utils/NamingViewer/ViewIORDialog.cpp +++ b/TAO/utils/NamingViewer/ViewIORDialog.cpp @@ -53,7 +53,7 @@ END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // ViewIORDialog message handlers -BOOL ViewIORDialog::OnInitDialog() +BOOL ViewIORDialog::OnInitDialog() { CDialog::OnInitDialog(); @@ -63,18 +63,18 @@ BOOL ViewIORDialog::OnInitDialog() // EXCEPTION: OCX Property Pages should return FALSE } -void ViewIORDialog::OnApply() +void ViewIORDialog::OnApply() { // TODO: Add your control notification handler code here UpdateData(); try { - m_Object = m_pORB->string_to_object(m_IOR); + m_Object = m_pORB->string_to_object(ACE_TEXT_ALWAYS_CHAR (m_IOR)); DecodeIOR(); } catch(CORBA::Exception& ex) { - MessageBox(ex._rep_id(), "CORBA::Exception"); + MessageBox(ACE_TEXT_CHAR_TO_TCHAR (ex._rep_id()), ACE_TEXT ("CORBA::Exception")); } } @@ -84,19 +84,19 @@ void ViewIORDialog::DecodeIOR() m_Profiles.DeleteAllItems(); m_TypeID = ""; UpdateData(FALSE); - + // if object is nil, return out if(CORBA::is_nil(m_Object)) { return; } - + // Get the stub TAO_Stub* pStub = m_Object->_stubobj(); const char* pType = pStub->type_id; m_TypeID = pType ? pType : ""; // special case for INS objects, tao doesn't get the type id UpdateData(FALSE); - + // Iterate through each profile and add an entry to the tree control const TAO_MProfile& BaseProfiles= pStub->base_profiles(); CORBA::ULong Count = BaseProfiles.profile_count(); @@ -106,12 +106,12 @@ void ViewIORDialog::DecodeIOR() HTREEITEM hProfile; switch(pProfile->tag()) { - case 0: //IOP::TAG_INTERNET_IOP: + case 0: //IOP::TAG_INTERNET_IOP: { TAO_IIOP_Profile* pIIOPProfile = (TAO_IIOP_Profile*)pProfile; CString ProfileString; - ProfileString.Format("IIOP %d.%d", - pIIOPProfile->version().major, + ProfileString.Format(ACE_TEXT ("IIOP %d.%d"), + pIIOPProfile->version().major, pIIOPProfile->version().minor); hProfile = m_Profiles.InsertItem(ProfileString); TAO_IIOP_Endpoint* pIIOPEndpoint = @@ -119,21 +119,21 @@ void ViewIORDialog::DecodeIOR() while(pIIOPEndpoint) { CString EndpointString; - EndpointString.Format("%s:%d", - pIIOPEndpoint->host(), + EndpointString.Format(ACE_TEXT ("%s:%d"), + pIIOPEndpoint->host(), pIIOPEndpoint->port()); HTREEITEM hItem = m_Profiles.InsertItem(EndpointString, hProfile); m_Profiles.EnsureVisible(hItem); pIIOPEndpoint = (TAO_IIOP_Endpoint*)pIIOPEndpoint->next(); } - + } break; default: { CString ProfileString; char* pToString = ((TAO_Profile*)pProfile)->to_string(); - ProfileString.Format("Unknown Profile (Tag=%d) %s", pProfile->tag(), pToString); + ProfileString.Format(ACE_TEXT ("Unknown Profile (Tag=%d) %s"), pProfile->tag(), pToString); delete pToString; hProfile = m_Profiles.InsertItem(ProfileString); } diff --git a/TAO/utils/catior/catior.cpp b/TAO/utils/catior/catior.cpp index 4352d5a75f6..a090259fcb4 100644 --- a/TAO/utils/catior/catior.cpp +++ b/TAO/utils/catior/catior.cpp @@ -22,6 +22,8 @@ #include "ace/Get_Opt.h" #include "ace/streams.h" #include "ace/OS_NS_ctype.h" +#include "ace/OS_NS_stdio.h" +#include "ace/Argv_Type_Converter.h" #include "tao/corba.h" #include "tao/IIOP_Profile.h" #include "tao/Messaging_PolicyValueC.h" @@ -460,15 +462,19 @@ catpoop (char* string } int -main (int argc, char *argv[]) +ACE_TMAIN (int argcw, ACE_TCHAR *argvw[]) { - ACE_Get_Opt get_opt (argc, argv, "f:n:"); - ACE_DECLARE_NEW_CORBA_ENV; - CORBA::ORB_var orb_var = CORBA::ORB_init (argc, argv, "TAO" ACE_ENV_ARG_PARAMETER); + ACE_Argv_Type_Converter argcon (argcw, argvw); + CORBA::ORB_var orb_var = CORBA::ORB_init (argcon.get_argc (), + argcon.get_ASCII_argv (), + "TAO" ACE_ENV_ARG_PARAMETER); CORBA::Boolean b = 0; int opt; + ACE_Get_Opt get_opt (argcon.get_argc (), argcon.get_TCHAR_argv (), + ACE_TEXT ("f:n:")); + while ((opt = get_opt ()) != EOF) { switch (opt) @@ -513,12 +519,12 @@ main (int argc, char *argv[]) have_some_input = 1; } #else - FILE* ifstr = ACE_OS::fopen (get_opt.opt_arg (), "r"); + FILE* ifstr = ACE_OS::fopen (get_opt.opt_arg (), ACE_TEXT ("r")); if (ifstr && !ferror (ifstr)) { if (ifstr) - ACE_OS::fclose (ifstr); + ACE_OS::fclose (ifstr); return -1; } @@ -596,7 +602,7 @@ main (int argc, char *argv[]) #if !defined (ACE_LACKS_IOSTREAM_TOTALLY) ifstr.close (); #else - ACE_OS::fclose (ifstr); + ACE_OS::fclose (ifstr); #endif /* !defined (ACE_LACKS_IOSTREAM_TOTALLY) */ } break; @@ -611,7 +617,7 @@ main (int argc, char *argv[]) "Reads an IOR " "and dumps the contents to stdout " "\n", - argv[0]), + argvw[0]), 1); } } diff --git a/TAO/utils/catior/catior.mpc b/TAO/utils/catior/catior.mpc index 6bb4ff143fc..d46f13a598a 100644 --- a/TAO/utils/catior/catior.mpc +++ b/TAO/utils/catior/catior.mpc @@ -1,4 +1,5 @@ // $Id$ project : taoexe, rtcorba, core { install = $(ACE_ROOT)/bin + exename = catior } diff --git a/TAO/utils/nslist/nsadd.cpp b/TAO/utils/nslist/nsadd.cpp index a177230a856..1394726c5d2 100644 --- a/TAO/utils/nslist/nsadd.cpp +++ b/TAO/utils/nslist/nsadd.cpp @@ -20,30 +20,36 @@ #include "orbsvcs/CosNamingC.h" #include "ace/Log_Msg.h" #include "ace/OS_NS_string.h" +#include "ace/Argv_Type_Converter.h" CORBA::ORB_var orb; int showIOR = 0; int showNSonly = 0; int -main (int argc, char *argv[]) +ACE_TMAIN (int argcw, ACE_TCHAR *argvw[]) { ACE_DECLARE_NEW_CORBA_ENV; ACE_TRY { + ACE_Argv_Type_Converter argcon (argcw, argvw); CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); + CORBA::ORB_init (argcon.get_argc (), argcon.get_ASCII_argv (), + "" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - char *pname = argv[0]; + int argc = argcon.get_argc (); + ACE_TCHAR** argv = argcon.get_TCHAR_argv (); - const char * ior = 0; - const char * name = 0; + ACE_TCHAR *pname = argv[0]; + + const ACE_TCHAR * ior = 0; + const ACE_TCHAR * name = 0; int rebind = 0; int newcontext = 0; while (argc > 0) { - if (ACE_OS::strcmp (*argv, "--ior") == 0) + if (ACE_OS::strcmp (*argv, ACE_TEXT ("--ior")) == 0) { if (argc == 1) { @@ -55,7 +61,7 @@ main (int argc, char *argv[]) argv++; ior = *argv; } - else if (ACE_OS::strcmp (*argv, "--name") == 0) + else if (ACE_OS::strcmp (*argv, ACE_TEXT ("--name")) == 0) { if (argc == 1) { @@ -67,15 +73,15 @@ main (int argc, char *argv[]) argv++; name = *argv; } - else if (ACE_OS::strcmp (*argv, "--rebind") == 0) + else if (ACE_OS::strcmp (*argv, ACE_TEXT ("--rebind")) == 0) { rebind = 1; } - else if (ACE_OS::strcmp(*argv, "--newcontext") == 0) + else if (ACE_OS::strcmp(*argv, ACE_TEXT ("--newcontext")) == 0) { newcontext = 1; } - else if (ACE_OS::strncmp (*argv, "--", 2) == 0) + else if (ACE_OS::strncmp (*argv, ACE_TEXT ("--"), 2) == 0) { ACE_DEBUG ((LM_DEBUG, "Usage: %s --name <name> " @@ -98,7 +104,7 @@ main (int argc, char *argv[]) CORBA::Object_var obj; if (ior) { - obj = orb->string_to_object (ior ACE_ENV_ARG_PARAMETER); + obj = orb->string_to_object (ACE_TEXT_ALWAYS_CHAR (ior) ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } @@ -116,7 +122,7 @@ main (int argc, char *argv[]) return 1; } char buf[BUFSIZ]; - ACE_OS::strcpy (buf, name); + ACE_OS::strcpy (buf, ACE_TEXT_ALWAYS_CHAR (name)); char *bp = &buf[0]; char *cp = 0; int ntoks = 0; diff --git a/TAO/utils/nslist/nsdel.cpp b/TAO/utils/nslist/nsdel.cpp index 9905c6b40f7..ddd6ac33365 100644 --- a/TAO/utils/nslist/nsdel.cpp +++ b/TAO/utils/nslist/nsdel.cpp @@ -21,6 +21,7 @@ #include "ace/Log_Msg.h" #include "ace/OS_NS_stdio.h" #include "ace/OS_NS_string.h" +#include "ace/Argv_Type_Converter.h" CORBA::ORB_var orb; int showIOR = 0; @@ -28,7 +29,7 @@ int showNSonly = 0; const char* USAGE = "Usage: %s [ --name <name> ] [--destroy]\n"; int -main (int argc, char *argv[]) +ACE_TMAIN (int argcw, ACE_TCHAR *argvw[]) { ACE_DECLARE_NEW_CORBA_ENV; @@ -36,16 +37,21 @@ main (int argc, char *argv[]) int destroy_after_unbind = 0; ACE_TRY { + ACE_Argv_Type_Converter argcon (argcw, argvw); CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); + CORBA::ORB_init (argcon.get_argc (), argcon.get_ASCII_argv (), + "" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - char *pname = argv[0]; - const char *name = 0; + int argc = argcon.get_argc (); + ACE_TCHAR** argv = argcon.get_TCHAR_argv (); + + ACE_TCHAR *pname = argv[0]; + const ACE_TCHAR *name = 0; while (argc > 0) { - if (ACE_OS::strcmp (*argv, "--name") == 0) + if (ACE_OS::strcmp (*argv, ACE_TEXT ("--name")) == 0) { if (argc == 1) { @@ -57,11 +63,11 @@ main (int argc, char *argv[]) argv++; name = *argv; } - else if (ACE_OS::strcmp (*argv, "--destroy") == 0) + else if (ACE_OS::strcmp (*argv, ACE_TEXT ("--destroy")) == 0) { destroy_after_unbind = 1; } - else if (ACE_OS::strncmp(*argv, "--", 2) == 0) + else if (ACE_OS::strncmp(*argv, ACE_TEXT ("--"), 2) == 0) { ACE_DEBUG ((LM_DEBUG, USAGE, pname)); return 1; @@ -78,7 +84,7 @@ main (int argc, char *argv[]) // make a copy char buf[BUFSIZ]; - ACE_OS::strcpy (buf, name); + ACE_OS::strcpy (buf, ACE_TEXT_ALWAYS_CHAR (name)); char *bp = &buf[0]; char *cp = 0; int ntoks = 0; diff --git a/TAO/utils/nslist/nslist.cpp b/TAO/utils/nslist/nslist.cpp index b1645512697..80dabc861b4 100644 --- a/TAO/utils/nslist/nslist.cpp +++ b/TAO/utils/nslist/nslist.cpp @@ -22,6 +22,7 @@ #include "tao/ORB_Constants.h" #include "ace/Log_Msg.h" #include "ace/OS_NS_stdio.h" +#include "ace/Argv_Type_Converter.h" CORBA::ORB_var orb; int showIOR = 0; @@ -214,7 +215,7 @@ list_context (CosNaming::NamingContext_ptr nc, } int -main (int argc, char *argv[]) +ACE_TMAIN (int argcw, ACE_TCHAR *argvw[]) { showIOR = 0; showNSonly = 0; @@ -222,14 +223,19 @@ main (int argc, char *argv[]) ACE_DECLARE_NEW_CORBA_ENV; ACE_TRY { - orb = CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); + ACE_Argv_Type_Converter argcon (argcw, argvw); + orb = CORBA::ORB_init (argcon.get_argc (), argcon.get_ASCII_argv (), + "" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - char *pname = argv[0]; + int argc = argcon.get_argc (); + ACE_TCHAR** argv = argcon.get_TCHAR_argv (); + + ACE_TCHAR *pname = argv[0]; while (argc > 0) { - if (strcmp(*argv, "--ior") == 0) + if (ACE_OS::strcmp(*argv, ACE_TEXT ("--ior")) == 0) { if (showNSonly) { @@ -240,7 +246,7 @@ main (int argc, char *argv[]) } showIOR = 1; } - else if (ACE_OS::strcmp (*argv, "--nsior") == 0) + else if (ACE_OS::strcmp (*argv, ACE_TEXT ("--nsior")) == 0) { if (showIOR) { @@ -251,11 +257,11 @@ main (int argc, char *argv[]) } showNSonly = 1; } - else if (ACE_OS::strcmp (*argv, "--ctxior") == 0) + else if (ACE_OS::strcmp (*argv, ACE_TEXT ("--ctxior")) == 0) { showCtxIOR = 1; } - else if (ACE_OS::strncmp (*argv, "--", 2) == 0) + else if (ACE_OS::strncmp (*argv, ACE_TEXT ("--"), 2) == 0) { ACE_DEBUG ((LM_DEBUG, "Usage: %s [[ --ior ][ --ctxior ] | --nsior ]\n", pname)); return 1; diff --git a/TAO/utils/nslist/nslist.mpc b/TAO/utils/nslist/nslist.mpc index 4b8ee5c03d7..7d704eb9b95 100644 --- a/TAO/utils/nslist/nslist.mpc +++ b/TAO/utils/nslist/nslist.mpc @@ -3,6 +3,7 @@ project(nsadd): namingexe, core { install = $(ACE_ROOT)/bin + exename = nsadd Source_Files { nsadd.cpp } @@ -10,6 +11,7 @@ project(nsadd): namingexe, core { project(nsdel): namingexe, core { install = $(ACE_ROOT)/bin + exename = nsdel Source_Files { nsdel.cpp } @@ -17,6 +19,7 @@ project(nsdel): namingexe, core { project(nslist): namingexe, core { install = $(ACE_ROOT)/bin + exename = nslist Source_Files { nslist.cpp } |