Opened 15 years ago

Last modified 15 years ago

#1083 closed Bug

ClipPut Function bug or limitation-from ticket 1043 — at Initial Version

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

Description

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

Change History (1)

Changed 15 years ago by sistemas@…

notepad++ display of the string example content

Note: See TracTickets for help on using tickets.