Figure 4 Updating Shared Properties

  Dim spm As SharedPropertyGroupManager
Dim pg As SharedPropertyGroup
Dim p1 As SharedProperty, p2 As SharedProperty
Dim AlreadyExists As Boolean
' create and bind to two shared properties
Set spm = New SharedPropertyGroupManager
Set pg = spm.CreatePropertyGroup("MyGroup", _
                                 LockMethod, _
                                 Process, _
                                 AlreadyExists)
Set p1 = pg.CreateProperty("MyProp1", AlreadyExists)
Set p2 = pg.CreateProperty("MyProp2", AlreadyExists)
' read a value
Dim x As Long
x = p.Value
' assign a value
p1.Value = x + 10
p2.Value = p1.Value + 20
' clean up
Set p1 = Nothing
Set p2 = Nothing
Set pg = Nothing
Set spm = Nothing