V
visio_newbie
Hi all,
My developing environment:
MS Win 2000 sp4
VB6 SP6
Visio 2003 standard SP2
In VB, the code for the event is as follows:
Private Function vdcFlow_QueryCancelSelectionDelete(ByVal selection As
Visio.IVSelection) As Boolean
Dim RetVal As VbMsgBoxResult
If selection.Item(1).Type = visTypeGroup Then
RetVal = MsgBox("Are you sure you want to delete step " &
selection.Item(1).Name & "?", vbQuestion + vbOKCancel)
If RetVal = vbOK Then
'Proceed to delete the step from table Step
If Not DeleteStep(Val(selection.Item(1).NameU)) Then
MsgBox "Failed to delete the step.", vbExclamation
End If
Else
vdcFlow_QueryCancelSelectionDelete = True
End If
End If
End Function
No matter which button (OK or Cancel) is clicked, the application
crashes with error "Visual Basic has encountered a problem and needs to
close. We are sorry for the inconvenience...." after executing End
Function.
Can anybody shed some light on what I am doing wrong?
Thanks in advance.
Chu
My developing environment:
MS Win 2000 sp4
VB6 SP6
Visio 2003 standard SP2
In VB, the code for the event is as follows:
Private Function vdcFlow_QueryCancelSelectionDelete(ByVal selection As
Visio.IVSelection) As Boolean
Dim RetVal As VbMsgBoxResult
If selection.Item(1).Type = visTypeGroup Then
RetVal = MsgBox("Are you sure you want to delete step " &
selection.Item(1).Name & "?", vbQuestion + vbOKCancel)
If RetVal = vbOK Then
'Proceed to delete the step from table Step
If Not DeleteStep(Val(selection.Item(1).NameU)) Then
MsgBox "Failed to delete the step.", vbExclamation
End If
Else
vdcFlow_QueryCancelSelectionDelete = True
End If
End If
End Function
No matter which button (OK or Cancel) is clicked, the application
crashes with error "Visual Basic has encountered a problem and needs to
close. We are sorry for the inconvenience...." after executing End
Function.
Can anybody shed some light on what I am doing wrong?
Thanks in advance.
Chu