From: Mike Williams on
"Ralph" <nt_consulting64(a)yahoo.com> wrote in message
news:OUJyUHRbKHA.5472(a)TK2MSFTNGP02.phx.gbl...

> . . . the "dye has been cast" before the code itself ever runs.

.. . . and the die . . . that's been cast as well ;-)

Mike



From: Martin Trump on

> right, size alone won't tell you anything for sure. That's what a ahsh
> function is for. Using a simple CRC32 function on the two data sets would
> tell you pretty much right away if the data is the same.

If it's a .bmp the header (bytes 0-53) will be the same for a given
screen resolution. The picture data is in multiples of 4-bytes. Wouldn't
it be easier/quicker to do long word comparisons? Just a thought.
From: Nobody on
"Martin Trump" <martin(a)wmeadow.demon.co.uk> wrote in message
news:rvTOm.2784$Lu6.357(a)newsfe05.ams2...
>
>>>> 3 - You need to use "Set" with any object assignment, so use "Set
>>>> pic2.Picture = Clipboard.GetData()".
>>> Really? pic2.Picture = Clipboard.GetData() seems to work for me.
>>
>> Yes both w/out Set work for me, in VBA too. I've never quite understood
>> why.
>
> All this is getting too complicated for me. For amusement only may I claim
> to have the smallest VB project ever posted, one line of executable code?
>
> In VB a project put a button and a PictureBox on Form1. The _only_ code is
> :-
>
> Private Sub Command1_Click()
>
> Picture1.Picture = Clipboard.GetData()
>
> End Sub
>
> Open any picture in Paint, CNTR+A, CNTR+C, run the VB and click the button
> and the picture appears. KISS?

I am a big believer in KISS too. The construct you are using works in this
particular situation because the object has default property(Handle), and
the object itself has limited properties, and they are set when the handle
property is modified. This does not work with most objects. If the object
doesn't have a default property, you get a compile time error until you use
Set. If it has default property, then only that property is copied. When you
use "Set" the object is not copied, but a reference is added to the already
existing object, unless you use "New" keyword, in which case another object
is created.

This sample illustrates:

Option Explicit

Private Sub Command1_Click()
Dim o As IPictureDisp

Set o = Clipboard.GetData
Picture1.Picture = o

Debug.Print Picture1.Picture.Handle
Debug.Print Picture1.Picture.Width
Debug.Print Picture1.Picture.Height
'Debug.Print Picture1.Picture.hPal
Debug.Print Picture1.Picture.Type

Debug.Print o.Handle
Debug.Print o.Width
Debug.Print o.Height
'Debug.Print o.hPal
Debug.Print o.Type
End Sub


Output:

Case 1: Without Set:

621091395
8387
3254
1
621091395
8387
3254
1

Case 2: Using Set:

352663803
8387
3254
1
352663803
8387
3254
1

The results are identical, but again, this won't work for most objects.


From: Ralph on

"Mike Williams" <Mike(a)WhiskyAndCoke.com> wrote in message
news:%23hzWfYSbKHA.5576(a)TK2MSFTNGP02.phx.gbl...
> "Ralph" <nt_consulting64(a)yahoo.com> wrote in message
> news:OUJyUHRbKHA.5472(a)TK2MSFTNGP02.phx.gbl...
>
> > . . . the "dye has been cast" before the code itself ever runs.
>
> . . . and the die . . . that's been cast as well ;-)
>

Yeah, that too. <g>

Not sure why I used the word "dye" except by poorly formed habit when young,
as I have since made a conscious decision to force myself to use the more
commonly accepted quote as "the die is cast" from the reported - "Alea iacta
est". Where "alea" is most certainly the singular of the word for "dice" - a
gambling device.

However, it turns out that there are other reported quotes. Ignoring those
that suggest "die" is the pattern or mold before a metal is poured. (As they
are certainly insane.) The other has Caesar quoting a Greek idiom/proverb in
which once a "dye" or coloring substance has been thrown into the water
there is no going back. This is more colorful and seems a better fit for a
dramatic scene where Caesar, a man who ardently wanted to be viewed as
educated, is standing before the waters of the Rubicon.

[Patrician Romans loved quoting Greek phrases, and Caesar did so often in
his writings. Something akin to using French now days to sound more
enlightened.]

But since most historians of that time provide a quote referring to a
'gaming device' I've accepted that "the die is cast" is most likely correct.
I just can't always remember to catch myself before typing. <g>

-ralph


From: Bob Butler on

"Ralph" <nt_consulting64(a)yahoo.com> wrote in message
news:O50agkTbKHA.4688(a)TK2MSFTNGP06.phx.gbl...
<cut>
> However, it turns out that there are other reported quotes. Ignoring those
> that suggest "die" is the pattern or mold before a metal is poured. (As
> they
> are certainly insane.)

Why would they be certainly insane? If the die has been cast then you've
already made the piece so it's too late to make any more changes to the
die... seems to fit as well as the others.