On Dec 29, 2006, at 1:15 PM, Chuck Pelto wrote:

The relatedWindow is not JUST a plain Window, it is a Window2
A Window does not have a property called "aProperty" but a Window2 does
The problem is that you're not using the right kind of variable

Actually, aProperty is just a generic name for any sort of property that one could declare. Sort of like myFoo.

If you declare relatedWindow as Window2 this would work

The problem is that I want something that is more generic for ANY sort of Window. Not just a Window2 or Window3. I'm looking for something that can be set to either a Window2 or Window3 or WindowX.

You can - a Window

BUT (as others have pointed out) this only gives you access to the properties of an item that is of the Window Class and none of the extra properties you added because they do not exist in a Window They only exist in your new Window instances, which are both a "Window" and maybe a "Window1", or "Window2" etc

In order to access those additional properties you have to know what kind of Window it is and treat it as such

A property of that type OR a cast (as Charles and others pointe out) is required

No magic required _______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to