huikm
May 28th, 2001, 04:13 AM
I have a class module (A) that raise events. In my app, I create an array of objects of type class A in a form. VB6 documentation says I cannot do such things:
Dim withevents arrA(4) as A
while i understand (sort of ) the reason behind this (connection and stuff), how else can i capture the events of such array of objects implementation. Currently, i am using a not-so elegant workaround
dim withevents obj1 as A
dim withevents obj2 as A
dim withevents obj3 as A
dim withevents obj4 as A
dim arrA(4) as new A
'''
set obj1 = arrA(0)
set obj2 = arrA(1)
set obj3 = arrA(2)
set obj4 = arrA(3)
where arrA() is the array of objects of type class A. The problem is the array size has to be fixed while i want it dynamic. The events object variables has to be incremented/decremented.
Setting reference for each arrA() element is not too good, because all objects can generate events simultaneously.
Probably an ActiveX control will solve the problem but i am trying to avoid that.
appreciate any help/suggestion.
Dim withevents arrA(4) as A
while i understand (sort of ) the reason behind this (connection and stuff), how else can i capture the events of such array of objects implementation. Currently, i am using a not-so elegant workaround
dim withevents obj1 as A
dim withevents obj2 as A
dim withevents obj3 as A
dim withevents obj4 as A
dim arrA(4) as new A
'''
set obj1 = arrA(0)
set obj2 = arrA(1)
set obj3 = arrA(2)
set obj4 = arrA(3)
where arrA() is the array of objects of type class A. The problem is the array size has to be fixed while i want it dynamic. The events object variables has to be incremented/decremented.
Setting reference for each arrA() element is not too good, because all objects can generate events simultaneously.
Probably an ActiveX control will solve the problem but i am trying to avoid that.
appreciate any help/suggestion.