[omniORB] Hard-coding NameService location ?

Duncan Grisby dgrisby@uk.research.att.com
Fri, 20 Oct 2000 12:45:42 +0100


On Thursday 19 October, Kevin Bailey wrote:

> Is there any way to specify the location of the NameService
> within the code (as opposed to the command line or a config
> file) ?  I've tried giving various strings to
> orb->resolve_initial_references() along the lines of corbaloc:...
> and corbaname:... but none I've tried work.  The reason I need
> this is that my application will be sort of embedded and
> without a command line or file system.  I suppose I could
> muck with argv but I was hoping there was something a little
> cleaner.

The simplest thing to do is to avoid resolve_initial_references() and
just use string_to_object(). That way, you can hard-code either a
corbaloc / corbaname string or an IOR. Something like

  CORBA::Object_var obj = orb->string_to_object("corbaname::namehost");
  CosNaming::NamingContext_var nc = CosNaming::NamingContext::_narrow(obj);


Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --