[omniORB] simple question

zhangzq71 zhangzq71@21cn.com
Mon, 22 Oct 2001 16:19:13 +0800


This is a multi-part message in MIME format.

------=_NextPart_000_0037_01C15B15.49E68710
Content-Type: text/plain;
	charset="gb2312"
Content-Transfer-Encoding: quoted-printable

for example

CORBA::Object_var obj =3D orb->string_to_object(IORstring);
mynamespace::myobj_var    myobjref =3D myobj::_narrow(obj);

now if the IORstring changed(eg, the servant was changed to another IP), =
and do not want to declare more mynamespace::myobj_var variable, just =
use myobjref, how can I do?

IORString =3D anotherIORString;
obj =3D orb->string_to_object(IORString);
(what should I do here?)
myobjref =3D myobj::_narrow(obj);


Thank you.

------=_NextPart_000_0037_01C15B15.49E68710
Content-Type: text/html;
	charset="gb2312"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dgb2312">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>for example</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>CORBA::Object_var obj =3D=20
orb-&gt;string_to_object(IORstring);</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>mynamespace::myobj_var&nbsp;&nbsp;&nbsp;=20
myobjref&nbsp;=3D myobj::_narrow(obj);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>now if the IORstring changed(eg, the =
servant was=20
changed to another IP), and do not want to declare more =
mynamespace::myobj_var=20
variable, just use myobjref, how can I do?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>IORString =3D =
anotherIORString;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>obj =3D=20
orb-&gt;string_to_object(IORString);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>(what should I do here?)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>myobjref =3D =
myobj::_narrow(obj);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thank you.</FONT></DIV></BODY></HTML>

------=_NextPart_000_0037_01C15B15.49E68710--