IiopObjectSetComponent Function

Action

Appends or replaces an component of an IOR. If the specified component exists in the selected profile and the tag of the component matches, the component is replaced. This can be suppressed by using the flag IIOP_NO_REPLACE. If a replacement is impossible because the component does not exist, the function appends the component to the list within the profile. This again can be suppressed by the flag IIOP_NO_APPEND.

Include file

IIOP.bdh

Syntax

IiopObjectSetComponent( in hIiop      : number,
                        in nProfile   : number,
                        in nComponent : number,
                        in nTag       : number,
                        in sData      : string,
                        in nDataLen   : number optional): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hIiop Handle to a CORBA Object.
nProfile

Index of the Internet profile to change. Set this parameter to IIOP_FIRST or IIOP_LAST to change the first or the last profile, respectively.

The index of the first profile is zero (0).

nComponent

Index of the component. Set this parameter to IIOP_FIRST or IIOP_LAST for the first or the last component, respectively. In addition, you can supply one either the IIOP_NO_REPLACE or the IIOP_NO_APPEND flag.

The index of the first component is zero (0).

nTag Component tag to set.
sData Component data including the byte order flag.
nDataLen Amount of component data in bytes (optional).

Example

const
  sAltHost := "192.168.20.20";
  nAltPort := 1033;

dcltrans
  transaction TMain
  var
    sData : string;
    nLen  : number;
  begin
    // set an alternate IIOP address in an Internet profile
    // compute the size of the component data
    nLen := (4 + 4 + (strlen(sAltHost)+1) + 1) & 0xfffffffe + 2;
    SetChar(sData, 1, 1); // choose little endian
    SetLong(sData, 5, strlen(sAltHost)+1);
 // size of hostname    SetString(sData, 9, sAltHost);
 // hostname    SetUShort(sData, nLen-1, nAltPort);

     // 0x3 is the tag for an alternate IIOP address.
    IiopObjectSetComponent(hIiop, IIOP_FIRST, IIOP_FIRST, 0x3, sData, nLen);
  end TMain;