Re: Option Strict and late binding problem

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Daniel Klein (danielkleinad_at_hotmail.com)
Date: 02/14/05


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
>>



Relevant Pages

  • Re: How to deal with "missing points" in arrays
    ... Let's say I choose this solution: what I missing here is, ... fill an array elements with a NaN? ... This also facilitates exact value comparisons, ... any data to be computed in single precision. ...
    (comp.lang.fortran)
  • Re: Array and Pointer Tutorial
    ... I can't really put me pinpoint the exact part, but I know I'm missing ... some kind of underlying concept when I see the construction: ...
    (comp.lang.c)
  • Re: loss of folder information
    ... This has happened to me twice now where the exact dates missing ... All emails are stored in the database. ... the server with an IMAP account. ...
    (microsoft.public.mac.office.entourage)
  • Re: VLOOKUP
    ... You're missing the 4th argument to the function, which directs it to look ... for an *exact* match. ... irrespective of what value I input into K2, I get a result in cell K3 ...
    (microsoft.public.excel.newusers)
  • Re: A Candle for cutie (to get home safe)
    ... I can appreciate the emotional trauma that you're experiencing. ... the months that Samuel was missing I was worried about him day and night. ... Though the stress of having him missing was horrible, ...
    (rec.pets.cats.community)