Re: Option Strict and late binding problem
From: Daniel Klein (danielkleinad_at_hotmail.com)
Date: 02/14/05
- Next message: Nagaraj: "Re: How do I do this ?"
- Previous message: Steven S Tuma: "Database Question"
- In reply to: Samuel R. Neff: "Re: Option Strict and late binding problem"
- Next in thread: Chris Dunaway: "Re: Option Strict and late binding problem"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 14 Feb 2005 16:08:30 GMT
Just to put some closure on this, the piece I was missing was to do:
For Each objekt As ICloneable In myArrayList
It was the 'As ICloneable' that was missing.
Thanks Samuel, I has been educational to say the least.
Daniel Klein
On Wed, 02 Feb 2005 10:21:51 -0500, Samuel R. Neff
<blinex@newsgroup.nospam> wrote:
>
>The thing is, ICloneable.Clone() and Copy() are the exact same method.
>When you declare
>
>Function Copy() As Object Implements ICloneable.Clone
>
>Then you can execute this method via
>
>obj.Copy()
>
>or
>
>DirectCast(obj, ICloneable).Clone()
>
>And it calls the exact same method. This is called explicit interface
>implementation where you're implementing an interface method but
>internally using a different method name. This way when the object is
>declared as the type that defined it, "Clone" is not accessible, but
>"Copy" is. But you can cast it to ICloneable and then "Clone" is
>accessible. But no matter what you do, it calls the exact same code,
>the contents of the function.
>
>Sam
>
>
>On Wed, 02 Feb 2005 15:13:18 GMT, Daniel Klein
><danielkleinad@hotmail.com> wrote:
>
>>IClonaeable.Clone() will never work in this instance due the the 'extra
>>work' the Copy() methods have to do. However the ICopiable solution has
>>possibilities, I'll let you know. Thanks.
>>
>>What I was 'knocking' was the if/then logic, not .NET. Apology accepted ;-)
>>
>>Dan
>>
- Next message: Nagaraj: "Re: How do I do this ?"
- Previous message: Steven S Tuma: "Database Question"
- In reply to: Samuel R. Neff: "Re: Option Strict and late binding problem"
- Next in thread: Chris Dunaway: "Re: Option Strict and late binding problem"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|