关于Class_WriteProperties事件

xayzmb 2008-04-09 05:15:44
下面是一个类中的代码:
为什么在关闭程序时
没有触发Class_WriteProperties事件
(已将类的Instancing属性已设为 5 - MultiUse
persistable属性设为 1 )

Option Explicit
Dim strT As String
Private myT As Variant

Public Property Get myTest() As String
myTest = strT
PropertyChanged "myTest"
End Property

Public 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

哪位解决了与这个贴子一起给分http://topic.csdn.net/u/20080409/15/6b7a5a24-2e84-4749-90be-bc73dbdf5d2d.html
...全文
144 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
迈克揉索芙特 2008-04-10
  • 打赏
  • 举报
回复
我从微软找到的文章不对么?
接分再说
VBToy 2008-04-10
  • 打赏
  • 举报
回复
接分!更希望分享一下楼主的解决方法。
xayzmb 2008-04-10
  • 打赏
  • 举报
回复
问题已经自已解决了
进来的前十名有分
xayzmb 2008-04-09
  • 打赏
  • 举报
回复
按照MSDN的解释
"如果类中的某个属性被调用了 PropertyChanged,那么在类终止运行的时候 WriteProperties 事件将被触发。
"
可是上面的代码为什么不能触发WriteProperties事件呢?

864

社区成员

发帖
与我相关
我的任务
社区描述
VB COM/DCOM/COM+
c++ 技术论坛(原bbs)
社区管理员
  • COM/DCOM/COM+社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧