VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "c_NmBindingIterator"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'Generated by IDL2VB v120. Copyright (c) 1999 Martin.Both
'Source File Name: ../naming/CosNaming.idl
'Target File Name: c_NmBindingIterator.cls

Option Explicit

Implements cOrbAbstractBase
Implements cOrbObject

'interface ::CosNaming::BindingIterator
Const sTypeId As String = "IDL:omg.org/CosNaming/BindingIterator:1.0"
Private oObjRef As cOrbObjRef

'Helper to get different COM interface
Friend Function thisOrbAbstractBase() As cOrbAbstractBase
    Set thisOrbAbstractBase = Me
End Function

'Helper
Private Function cOrbAbstractBase_isObjRef() As Boolean
    cOrbAbstractBase_isObjRef = True
End Function

'Helper to get different COM interface
Friend Function thisOrbObject() As cOrbObject
    Set thisOrbObject = Me
End Function

'Helper
Private Function cOrbObject_setObjRef(ByVal ObjRef As cOrbObjRef, _
    ByVal Check As Boolean) As Boolean
    On Error GoTo ErrHandler
    If ObjRef Is Nothing Then
        cOrbObject_setObjRef = True
    Else
        cOrbObject_setObjRef = False
        Call ObjRef.narrow(sTypeId, Check, False)
    End If
    Set oObjRef = ObjRef
    Exit Function
ErrHandler:
    Call VBOrb.ErrReraise(Err, "setObjRef")
End Function

'Helper
Private Function cOrbObject_getObjRef() As cOrbObjRef
    Set cOrbObject_getObjRef = oObjRef
End Function

'Helper
Private Function cOrbObject_getId() As String
    cOrbObject_getId = sTypeId
End Function

'next_one()
Public Function nextOne(ByRef b As c_NmBinding) As Boolean
    On Error GoTo ErrHandler
    Dim oRequest As cOrbRequest
    Set oRequest = oObjRef.request("next_one", False)
    Dim oIn As cOrbStream
    Call oRequest.invokeReqst(False)
    Set oIn = oRequest.OutRes
    nextOne = oIn.readBoolean()
    Set b = New c_NmBinding
    Call b.initByRead(oIn)
    Exit Function
ErrHandler:
    Call VBOrb.ErrReraise(Err, "nextOne")
End Function

'next_n()
Public Function nextN(ByVal how_many As Long, ByRef bl As c_NmBindingSeq) _
    As Boolean
    On Error GoTo ErrHandler
    Dim oRequest As cOrbRequest
    Set oRequest = oObjRef.request("next_n", False)
    Dim oOut As cOrbStream
    Set oOut = oRequest.InArg
    Call oOut.writeUlong(how_many)
    Dim oIn As cOrbStream
    Call oRequest.invokeReqst(False)
    Set oIn = oRequest.OutRes
    nextN = oIn.readBoolean()
    Set bl = New c_NmBindingSeq
    Call bl.initByRead(oIn, 0)
    Exit Function
ErrHandler:
    Call VBOrb.ErrReraise(Err, "nextN")
End Function

'destroy()
Public Sub destroy()
    On Error GoTo ErrHandler
    Dim oRequest As cOrbRequest
    Set oRequest = oObjRef.request("destroy", False)
    Call oRequest.invokeReqst(False)
    Exit Sub
ErrHandler:
    Call VBOrb.ErrReraise(Err, "destroy")
End Sub
