Prod.: Engine, ver.: 6011, ID: 60000498, Bug : newValue parameter of BeforeModify event in vdraw Wrapper ocx is null

Bug : newValue parameter of BeforeModify event in vdraw Wrapper ocx is null

Article60000498
TypeBug
ProductEngine
Version6011
Date Added5/2/2008
FixedYes [5/2/2008]
Submitted bychristof duvenbeck
Keywords

Subject

newValue parameter of BeforeModify event in vdraw Wrapper ocx is null

Summary

newValue parameter of BeforeModify event in vdraw Wrapper ocx is null

Solution

fixed in 6012

Example in VB6:

''VectorDraw.Geometry.TLB need to be referenced.

Private Sub Command1_Click()
VDraw1.ActiveDocument.New
Dim c As VDrawI5.vdCircle
VDraw1.CommandAction.CmdCircle Array(0, 0, 0), 5
Set c = VDraw1.ActiveDocument.entities.Last
c.Radius = 1 ' radius < 2 are not permited
c.Radius = 3 ' this is a valid value
c.CenterPoint = Array(1, 1, 0)

End Sub


Private Sub Form_Load()
VDraw1.FreezeEntityEvents 0
End Sub


Private Sub VDraw1_BeforeModify(ByVal Figure As VDrawI5.vdPrimary, ByVal ModificationType As String, newValue As Variant, exValue As Variant, Cancel As Integer)
Debug.Print "BeforeModify: " & Figure.Type & " - " & ModificationType & " - " & newValue
If Figure.Type <> "VDCIRCLE" Then Exit Sub
If ModificationType = "Center" And TypeOf newValue Is VectorDraw_Geometry.gPoint Then
    Dim val As VectorDraw_Geometry.gPoint
    Set val = newValue
ElseIf ModificationType = "Radius" And VarType(newValue) = vbDouble Then
    Dim rad As Double
    rad = newValue
    If rad < 2 Then Cancel = 1
End If

End Sub