|
-
May 2nd, 2002, 02:52 AM
#1
WithEvents
If your app can create many instances of a class module, which has public events, then how to you catch it's events after it's been created. Say you change data in one of the 10 instances of the class modules, how do you catch it's Dirty event in the main app?
If the class module is in a collection the event is ignored and if it's in an array then you can't decalre them WITHEVENTS 
Anyone?
-
May 2nd, 2002, 02:58 AM
#2
You'll have to use callbacks, either from the individual classes to the collection or just from the class to some form of notify class.
-
May 2nd, 2002, 03:00 AM
#3
The sun is shining, so why am I pissed off?
Any examples? Need more explanation
-
May 2nd, 2002, 03:21 AM
#4
Here is an example which should explain it. Some of the properties are Friend instead of public but since the classes are in the project instead of a dll they show up anyway. Otherwise the collection and class wouldn't seem to be any different then normal.
-
May 2nd, 2002, 03:26 AM
#5
The earth is large and the sun is small
Cheers, I'll have a play now
-
May 2nd, 2002, 04:34 AM
#6
Make the class call a friend method in the collection object it belongs to, passing itself in as a parameter, then make the collection raise the event out to the big wide world, passing out hte class that caled the frind method
- gaffa
-
May 2nd, 2002, 04:48 AM
#7
To do this you need to have the Parent Collection class as a varible in each Object Class...doesn't this scoff memory like crazy???
-
May 2nd, 2002, 04:48 AM
#8
If it's not red then it must be a teapot...
To do this you need to have the Parent Collection class as a varible in each Object Class...doesn't this scoff memory like crazy???
-
May 2nd, 2002, 10:21 AM
#9
No because you are using SET (without new) so you really aren't creating another collection you are referencing the same one over again. If we passed it ByVal then we'd have some hefty memory.
-
May 2nd, 2002, 10:37 AM
#10
If it's a dream then I can do this...OW! *SLAP*
Just testing ya
-
May 2nd, 2002, 10:39 AM
#11

You know I think I make a point to read your threads just for the crazy caption dealies.
-
May 2nd, 2002, 10:44 AM
#12
On we go to another BBQ. It's in the North Pole...SOD THAT! Set fire to your house.
Thank you.
I try my best to lighten the atmosphere up while people are at work
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|