That's a quirk rather than a problem - Object3D *does* return the  
subclass, but the compiler doesn't know this unless you tell it. If  
you cast the return value to your subclass (as in my example below)  
the code in the bug report will work fine.

I don't actually use Object3D - I was just asking how Object3D  
manages to pull this trick so I could do something similar in my own  
classes.

Frank.
<http://developer.chaoticbox.com/>
<http://macgameblog.com/>

On 4-Apr-07, at 4:29 PM, Bob Keeney wrote:

> This has been around for a while.  And since I'm the only one to have
> signed on....
>
> http://support.realsoftware.com/feedback/viewreport.php?
> reportid=byccwcwi
>
> On Apr 4, 2007, at 3:11 PM, realbasic-nug-
> [EMAIL PROTECTED] wrote:
>
>>
>> Example:
>>
>>    Dim c1 As New MySubClass
>>    Dim c2 As MySubClass
>>    c2 = MySubClass( c1.Clone )
>>
>> If MySubClass is an Object3D that code will run fine, but if the
>> super is a home-brewed class that supplies a Clone function you'll
>> get a not-so-unexpected illegal cast exception. I can't think of a
>> way to do this in RB code - does Object3D use some sort of plugin SDK
>> voodoo?
>>
>> I probably could've emailed Joe directly for the answer, but this
>> felt like a fun problem for the list to ponder...




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

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to