Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / examples / Naming / test_non_existent.cpp
blob03516654670e2019ca7996d7e195e4aedf8559a3
1 #include "ace/OS_main.h"
2 #include "ace/Naming_Context.h"
3 #include "ace/Log_Msg.h"
6 int ACE_TMAIN (int, ACE_TCHAR *[])
8 int i;
10 ACE_STATIC_SVC_REGISTER(ACE_Naming_Context);
12 ACE_Naming_Context *ns_ptr;
13 ACE_NEW_RETURN (ns_ptr,
14 ACE_Naming_Context,
15 1);
17 ACE_Name_Options *name_options = ns_ptr->name_options ();
19 const ACE_TCHAR *m_argv[] =
21 ACE_TEXT("MyName"),
22 ACE_TEXT("-cNODE_LOCAL") ,
23 #if defined (ACE_WIN32)
24 ACE_TEXT("-lC:\\temp\\non_existent"),
25 #else
26 ACE_TEXT("-l/tmp/foobar.mine"),
27 #endif /* ACE_WIN32 */
31 int m_argc =
32 sizeof (m_argv) / sizeof (ACE_TCHAR *) -1;
34 name_options->parse_args (m_argc, (ACE_TCHAR**)m_argv);
36 i = ns_ptr->open (ACE_Naming_Context::NODE_LOCAL);
37 ACE_DEBUG ((LM_DEBUG,
38 "(%P) opened with %d\n",
39 i));
40 if (i != 0)
41 return -1;
43 i = ns_ptr->bind ("Key_Value",
44 "Val_Value",
45 "-");
47 ACE_DEBUG ((LM_DEBUG,
48 "(%P) bound with %d\n",
49 i));
50 return 0;