Modify

Opened 10 years ago

Closed 10 years ago

#1083 closed Bug (Fixed)

ClipPut Function bug or limitation-from ticket 1043

Reported by: sistemas@… Owned by: Jon
Milestone: 3.3.1.4 Component: AutoItX
Version: 3.3.0.0 Severity: Blocking
Keywords: clipboard ClipPut setclipboard characters length limitation Cc:

Description (last modified by Valik)

[from ticket 1043-more explanation]
If you put more than 127 characters into clipboard, this function fail and the clipboard is clear.
For understand this. The ClipPut function returns 0 (not a failure code), but the content of the clipboard is flushed, so the clipboard is empty after using ClipPut with a string with more than 127 characters.

I don't know why but I try with a string with {TAB},{CR}, and {LF} characters in this string.
I try with version 3.3.0 and beta version 3.3.1.1 and both have the same problem.

I don't know if this is a new limitation. But I think that the clipboard function must support 65535 chars at least.

But with version 3.2.12.1 this work fine and you can put into clipboard text with more than 127 characters.
So I must to put back the 3.2.12.1 version until this problem is fixed.

This happen with the 32bits version of the dll: AutoItX3.dll
Running under Windows 2003 R2 SP2 server.

If this can help...

Regards,

Ricky

if sTexto.value has more than 127 characters:

Clip.ClipPut sTexto.value FAIL!!! clipput flush the clipboard (empty)
Clip.ClipPut CStr(sTexto.value) FAIL!!!
Clip.ClipPut left(sTexto.value,128) FAIL!!!
Clip.ClipPut left(sTexto.value,127) WORK FINE

This is the script that fail:

sub main
'	*****************************************************
'	* This script need AutoItX3.dll
'	*
'	* Download and extract from:
'	* http://www.autoitscript.com/autoit3/downloads.shtml
'	*
'	*
'	* Copy to:
'	* C:\WINDOWS\system32\ 
'	*
'	* register with command:
'	* regsvr32.exe "C:\WINDOWS\system32\AutoItX3.dll"
'	*****************************************************
	on error resume next
	err.clear
	Set Clip = CreateObject ("AutoItX3.Control")
	'verify if DLL is missing or unregister
	if err.number <> 0 then
		msgbox "Se requiere AutoItX3.dll para copiar al portapapeles con la funcion 'SetClipboard'!" & vbcrlf & "Consulte al administrador...", vbCritical, "Error!"
	else
		'double check for errors
		copyerror = Clip.ClipPut(sTexto.value)
		copyerror = copyerror + Clip.error
		if copyerror = 0 then
			returnvalue = true
		else
			returnvalue = false
			msgbox "Error#" & copyerror & " al copiar al portapapeles con AutoItX3.dll!" & vbcrlf & "Consulte al administrador...", vbCritical, "AutoItX3.dll version " & Clip.version & " error!"
		end if
		'verify if the content of the string was copy to the clipboard
		if Clip.ClipGet = sTexto.value then
			returnvalue = true
		else
			returnvalue = false
			msgbox "Hubo un error al copiar al portapapeles con AutoItX3.dll!" & vbcrlf & "Consulte al administrador...", vbCritical, "AutoItX3.dll version " & Clip.version & " error!"
		end if
		Set Clip = nothing
	end if
	on error goto 0
end sub

END OF THE SCRIPT *
example of the failure
input variable:sTexto.value
len(sTexto.value)=431
sTexto.value="Descripcion: RENOLIN SC 68 - Tambor x 205
Codigo: 100233 - T2
Densidad: 0,869
Unidad de Medida: Litro
Envase: Tambor
Capacidad: 205 LTS
Tipo de Envase: TAMBOR ORIGINAL
Peso Neto: 178,14 KGR
Peso Bruto: 196,14 KGR
Número ONU: 1268
Carga IMO:
Pos. Arancelaria: 2710.19.32.900Z

PROVEEDORES:

2710.19.32.900Z ALEMANIA FUCHS EUROPE SCHMIERSTOFFE GMBH "

Attachments (1)

notepad.jpg (69.8 KB) - added by sistemas@… 10 years ago.
notepad++ display of the string example content

Download all attachments as: .zip

Change History (10)

Changed 10 years ago by sistemas@…

notepad++ display of the string example content

comment:1 follow-ups: Changed 10 years ago by sistemas@…

I try to reopen the Ticket 1043 but I can't, so I create a new one.

comment:2 in reply to: ↑ 1 Changed 10 years ago by Ricky Valdivia <sistemas@…>

Perhaps the problem is the regional settings or unicode.
I use Spanish-Argentina for all, including non-unicode.

Wrong component selected in the ticket!!'''

Switch to AutoItX

comment:3 follow-up: Changed 10 years ago by Ricky Valdivia <sistemas@…>

I really believe it's a unicode problem or definition type of the variables in AutoItX.dll

I test this:
1.) Run CLIPBRD.exe to see the clipboard in live.
2.) copy a lot of plain text to the clipboard, about 3000 chars.
3.) in debugging mode, test this sentence: Clip.ClipPut(Clip.ClipGet)

after that, the first 4 characters of the clipboard was replaced with this Unicode characters:
chrW(376)+chrW(2751)+chrW(376)+chrW(2751)+[rest of the clipboard]

in OEM Text this is similar to this:
chr(159)+chr(63)+chr(159)+chr(63)+[rest of the clipboard]

This is very strange, but I think is useful to detect the failure.

comment:4 in reply to: ↑ 3 Changed 10 years ago by Ricky Valdivia <sistemas@…>

Repeating the test:

1.) Copy to the clipboard the content of the example above (sTexto.value="Descripcion...")
2.) Running again Clip.ClipPut(Clip.ClipGet)

flush/empty the clipboard again.

comment:5 in reply to: ↑ 1 Changed 10 years ago by Valik

Replying to sistemas@…:

I try to reopen the Ticket 1043 but I can't, so I create a new one.

I guess you're too stupid to realize you can still add comments to a closed ticket?

Go read WikiStart. Now, before you even bother replying. It's perfectly clear you haven't read it because you've done a number of very annoying things that are covered by WikiStart.

comment:6 follow-up: Changed 10 years ago by Valik

  • Component changed from AutoIt to AutoItX
  • Description modified (diff)
  • Owner set to Jon

comment:7 in reply to: ↑ 6 Changed 10 years ago by Ricky Valdivia <sistemas@…>

Replying to Valik:

You are wright! Sorry, my mistake.

comment:8 Changed 10 years ago by Valik

  • Severity changed from None to Blocking

comment:9 Changed 10 years ago by Jon

  • Milestone set to 3.3.1.4
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed in version: 3.3.1.4

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The owner will remain Jon.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.