LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Resolve object pointer any use for this?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to use Formula to resolve Sky Excel Worksheet Functions 5 May 7th 09 01:07 AM
#REF! Error Resolve? Dan the Man[_2_] Excel Worksheet Functions 2 July 30th 07 03:28 AM
Did you ever resolve this? [email protected] Excel Discussion (Misc queries) 1 April 24th 07 02:34 PM
how to resolve a printer name Bert van den Brink Excel Programming 1 July 30th 06 10:39 AM
Another issue to resolve Pat Excel Programming 11 February 20th 05 09:01 PM


All times are GMT +1. The time now is 07:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"