下面是一个类中的代码:
为什么在关闭程序时
没有触发Class_WriteProperties事件
(已将类的persistable属性设为 1 )Option Explicit
    Dim strT As String
    Private myT As VariantPublic Property Get myTest() As String
    myTest = strT
    PropertyChanged "myTest"
End PropertyPublic Property Let myTest(newTest As String)
    strT = newTest
    PropertyChanged "myTest"
End Property
Private Sub Class_ReadProperties(PropBag As PropertyBag)
    myTest = PropBag.ReadProperty("myTest", myT)
End Sub
Private Sub Class_WriteProperties(PropBag As PropertyBag)
    PropBag.WriteProperty "myTest", myTest, myT
End Sub

解决方案 »

  1.   

    类的Instancing属性已设为 5 - MultiUse
      

  2.   

    楼上差矣,不设置Instancing成为5又如何设置persistable属性呢。楼主请仔细阅读:
    将对象以参数形式传递到 COM+ 列队组件中
    http://support.microsoft.com/kb/246627/zh-cn
      

  3.   

    请明示:为什么没有触发Class_WriteProperties事件 ?
      

  4.   

    你程序关闭时为什么要触发Class_WriteProperties事件 ?
    程序关闭,一般来说,对象也应该释放,哪么WriteProperty又有什么用呢?
    我是不明白瞎说,请高手来回答吧
      

  5.   

    [code=C#]
    private int A()
    {
    }
    [code]
    //以上代码测试UBB.....
      

  6.   

    [code=C#]
    [BanUBB]
    using System;
    private int A() 


    [/BanUBB]
    [code] 
    //再次测试UBB.....