VBPersistObject.cls
上传用户:bjlvip
上传日期:2010-02-08
资源大小:744k
文件大小:1k
- VERSION 1.0 CLASS
- BEGIN
- MultiUse = -1 'True
- Persistable = 1 'Persistable
- DataBindingBehavior = 0 'vbNone
- DataSourceBehavior = 0 'vbNone
- MTSTransactionMode = 0 'NotAnMTSObject
- END
- Attribute VB_Name = "Testing"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = True
- Attribute VB_PredeclaredId = False
- Attribute VB_Exposed = True
- Dim m_x As Integer
- Dim m_y As Integer
- Function Sum(x As Integer, y As Integer) As Integer
- Sum = x + y
- m_x = x
- m_y = y
- End Function
- Private Sub Class_Initialize()
- MsgBox "Initialize"
- End Sub
- Private Sub Class_Terminate()
- MsgBox "Terminate"
- End Sub
- Private Sub Class_InitProperties()
- MsgBox "InitProperties"
- m_x = 4
- m_y = 3
- End Sub
- Private Sub Class_ReadProperties(PropBag As PropertyBag)
- m_x = PropBag.ReadProperty("x", 0)
- m_y = PropBag.ReadProperty("y", 0)
- MsgBox "ReadProperties m_x = " & m_x & " and m_y = " & m_y
- End Sub
- Private Sub Class_WriteProperties(PropBag As PropertyBag)
- MsgBox "WriteProperties m_x = " & m_x & " and m_y = " & m_y
- PropBag.WriteProperty "x", m_x
- PropBag.WriteProperty "y", m_y
- End Sub