Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi RBS,
Thanks for confirming my thoughts and clarifying all this. So, all in all a very interesting technique, but unfortunately, no good place to use it. Well, it *can* be done. I've done it for a fairly complex system before. It was for pooling and "resurrection" purposes, not to prevent circular references, but it's basically the same idea. It was complex to set up, and mind-numbingly hard to debug if you hit a problem. I did get it running 100%, but I wouldn't want to have to do that again, if it could be avoided. By the way, weak references in .NET are not needed nearly as much, because the circular reference problem is solved. So the only real reason for weak references in .NET is for "resurrection" purposes, or sometimes for tracking objects (something along the lines of profiling: is the object still alive?), but not for solving circular references. And weak references in .NET are built into the system; it's not a hack that cause any sort of non-recoverable GPF. So the concept of using weak references is fine; but in VB6 or VBA it really is a hack that is hard to get right. It's not impossible to get right, but it is tricky, fragile, and insanely difficult to debug if you hit a problem. I think there might be situations where it makes sense to use the ObjPtr as a key in a collection of objects, but that is something else and has nil to do with getting the full object reference from the ObjPtr. Ah, yes, that is a very solid use indeed. That would work 100% fine... So long as one held a strong reference! So unless you had some other means to ensure that the object did not go out of scope, the collection would have to hold a reference to the object being used as the key, as well as use the ObjPtr for the object as the key. Just storing the ObjPtr key alone could be trouble! -- Mike "RB Smissaert" wrote: Hi Mike, Thanks for confirming my thoughts and clarifying all this. So, all in all a very interesting technique, but unfortunately, no good place to use it. I think there might be situations where it makes sense to use the ObjPtr as a key in a collection of objects, but that is something else and has nil to do with getting the full object reference from the ObjPtr. RBS |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Is there a way to use Formula to resolve | Excel Worksheet Functions | |||
#REF! Error Resolve? | Excel Worksheet Functions | |||
Did you ever resolve this? | Excel Discussion (Misc queries) | |||
how to resolve a printer name | Excel Programming | |||
Another issue to resolve | Excel Programming |