Strange ? Did you say strange ?

In a current project, I had this code:

Dim Clip As New Clipboard Clip.Picture = MyPict Clip.Close

MyPict is then displayed (MyCanvas.Backdrop = MyPict)

This worked fine on macOS, but crashed on Windows.

When I commented the three lines (in Windows, then run in the ide / build the application), the crash stopped.

Why this code ? It was a debug scorie.

But the question remains: I may want to have that image in the Clipboard.

Edit: Typo removal.

I’m guessing Clip.Close is the probable issue. Replace that with Clip = Nil.

Thanks Tim.

I only followed the documentation guidelines.

That works on windows, if I try. Just to have that done… Did you try to set delaymbs 1 (or something like that) before closing?
Which Windows version? When do you do that?

Xojo 2016r4?

Could be a bug introduced with switch to direct draw.

You can use clipboard class in mbs plugins until there is a fix.

Windows XP. Windows 10: not tested.

When do I do that ?
After resizing a dropped image. I put the resized image in the Clipboard (to be sure of the resized work), then I put the resized image in a Canvas’ Backdrop.

I do not make further searches since I do not need that / I started to get tons of other bugs (like a window height whose height changes on Windows vs stays the same on macOS with results of controls that moves…), etc.

Today seems to be a bad day for me to use Xojo.
(I had an application that crashed many times on Windows 10 - while my macOS Sierra is updated to the last beta - and works fine on macOS Sierra…)
I really have to stop using Xojo with Firefox running and internet active.