Windows Clipboard Issue

I have a button on a Window that copies the contents of a TextArea to the clipboard so the user can paste it elsewhere (outside of the xojo app).

The code is simple…

[code]Sub CopyTextToClipboard inText As String

Dim c as New Clipboard
c.text=inText
c.close[/code]

This has been working fine; however, since we upgraded the OS to Win 7 (and in testing on Win10) this code will only copy the first paragraph of text whereas before it would copy the entire contents which could be several paragraphs long.

Any ideas / fixes ???

Thanks in advance.

did you report a feedback case?

does your text maybe contain a chr(0) inside?
Most OS Functions use that as end of text character.

I also run a master copy of the app on a Win Server 2012 and this copy function works just fine there.

No, I did not submit a feedback case … looking here for solution first.

This is very strange… 2 different PCs, both running Win7 SP1 … the copy function works on one of them but not the other … ???

In other words, on one machine it gets all of the text in the Textarea and on the other machine, it only gets the first paragraph.

I just tried under Windows 10, I can copy 16K text no issue.

did you check for null character?

or maybe no text encoding set for the text?

I didn’t; however, if there was a Null character, why would it work on one and not another?

Again, why one machine works and not the other … they both use the same back end database.

yup, this is very strange … I haven’t tested this on all of our 50+ workstations / servers, etc but I have on 6.

One has Win10 – doesn’t copy all text
4 have Win7 SP1 although one of those 4 is a different model – the different model copies all text, the other 3 don’t
and then there’s the server which runs Win Server 2012 – copies all text

hmmmm… I should mention that all of the one’s that won’t copy all the text are the same model of PC. All are Dell Optiplex 3011 All-in-One systems.

I agree with Christian, it sure seems like an encoding problem. As for why it works on some machines and not others, who knows? Are they configured 100% the same? Perhaps they have different DB driver versions? Best to check the encoding to be sure.

[quote=213473:@Rick Yerex]yup, this is very strange … I haven’t tested this on all of our 50+ workstations / servers, etc but I have on 6.

One has Win10 – doesn’t copy all text
4 have Win7 SP1 although one of those 4 is a different model – the different model copies all text, the other 3 don’t
and then there’s the server which runs Win Server 2012 – copies all text

hmmmm… I should mention that all of the one’s that won’t copy all the text are the same model of PC. All are Dell All-in-One systems.[/quote]

Could it be some utility in the machines that truncate the content of the clipboard ? That is the issue sometimes with all that bloatware …

Paul, how do I check the encoding?

The DB driver is built into the app and connects to MySQL db on the server.

I use the MySQL driver supplied with xojo [mySQLCommunityServer].

Not sure what you’re referring to by “bloatware”. These All-in-One workstations are pretty basic setups with very few apps and are all configured the same. Maybe they don’t have the conventional “clipbrd.exe” app for some reason? I’ll dig into that.

Bloatware is the bundled software that comes with some machines.

You may want to test the issue with another app. If it happens with Notepad, for instance, then it is the system and not Xojo.

[quote=213487:@Michel Bujardet]Bloatware is the bundled software that comes with some machines.

You may want to test the issue with another app. If it happens with Notepad, for instance, then it is the system and not Xojo.[/quote]

We order Dell systems with no bloatware … just the basic OS. Each machine is cleaned of anything unnecessary, end-user apps are installed and configured, and an image is made and applied to the workstations.

I have already tested the standard windows Copy / Paste.

The Debugger for the variable in question can tell you the encoding. Or the Encoding method.

As the MySQL page notes:

I modified the app’s code to define the encoding for the Textarea’s data and tested … doesn’t make any difference.