VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "c_ValTypeAccountExample"
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: ../demos/obv/valuetype/valuetype.idl
'Target File Name: c_ValTypeAccountExample.cls

Option Explicit

'You can use this class as a value example:
' Rename class to c_ValTypeAccount and save the file as c_ValTypeAccount.cls.
' Finally write your own local value operations.

Implements cOrbAbstractBase
Implements cOrbValueBase

'valuetype ::obv::valuetype::Account
Const sTypeId As String = "IDL:obv/valuetype/Account:1.0"

Private name As String
Public address As String
Private balance As Single

'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 = False
End Function

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

Private Function cOrbValueBase_UniqueId() As Long
    cOrbValueBase_UniqueId = VBOrb.getNextUniqueId()
End Function

'Helper
Private Sub cOrbValueBase_initByRead(ByVal oIn As cOrbStream)
    On Error GoTo ErrHandler
    name = oIn.readString()
    address = oIn.readString()
    balance = oIn.readFloat()
    Exit Sub
ErrHandler:
    Call VBOrb.ErrReraise(Err, "Account.read")
End Sub

'Helper
Private Sub cOrbValueBase_writeMe(ByVal oOut As cOrbStream)
    On Error GoTo ErrHandler
    Call oOut.writeString(name)
    Call oOut.writeString(address)
    Call oOut.writeFloat(balance)
    Exit Sub
ErrHandler:
    Call VBOrb.ErrReraise(Err, "Account.write")
End Sub

Private Function cOrbValueBase_getIds(ByVal Item As Integer) As String
    Select Case Item
    Case 0: cOrbValueBase_getIds = sTypeId
    End Select
End Function

Private Function cOrbValueBase_isCustom() As Boolean
    cOrbValueBase_isCustom = False
End Function

'init()
Public Sub init(ByVal name As String, ByVal address As String, _
    ByVal balance As Single)
    On Error GoTo ErrHandler
    'Please write your code here after copying this file
    'instead of throwing an exception
    'e.g. Call oDelegate.init(name, address, balance)
    Call VBOrb.raiseNOIMPLEMENT(0, VBOrb.CompletedNO)
    Exit Sub
ErrHandler:
    Call VBOrb.ErrReraise(Err, "init")
End Sub

'debit()
Public Sub debit(ByVal amount As Single)
    On Error GoTo ErrHandler
    'Please write your code here after copying this file
    'instead of throwing an exception
    'e.g. Call oDelegate.debit(amount)
    Call VBOrb.raiseNOIMPLEMENT(0, VBOrb.CompletedNO)
    Exit Sub
ErrHandler:
    Call VBOrb.ErrReraise(Err, "debit")
End Sub

'credit()
Public Sub credit(ByVal amount As Single)
    On Error GoTo ErrHandler
    'Please write your code here after copying this file
    'instead of throwing an exception
    'e.g. Call oDelegate.credit(amount)
    Call VBOrb.raiseNOIMPLEMENT(0, VBOrb.CompletedNO)
    Exit Sub
ErrHandler:
    Call VBOrb.ErrReraise(Err, "credit")
End Sub
