Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21256

[VBRichClient] VB crash adding two objects with the same key to a cEventCollection

$
0
0
Sample code (in a VB form):

Code:

Event test()

Dim WithEvents ec As cEventCollection

Private Sub Command1_Click()
  RaiseEvent test
End Sub

Private Sub ec_EventRaised(Key As String, EventName As String, ByVal ParamCount As Long, P1 As Variant, P2 As Variant, P3 As Variant, P4 As Variant, P5 As Variant, P6 As Variant, P7 As Variant, P8 As Variant)
  Debug.Print "Event '" & EventName & "' of '" & Key & "' raised"
End Sub

Private Sub Form_Load()
  Set ec = New_c.EventCollection
  ec.Add Me, "o1"
  ec.Add Me, "o1"  ' this line generates an error (as is logical), but then VB crash
End Sub

RC5 v5.0.10

Regards

Viewing all articles
Browse latest Browse all 21256

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>