Jump to content

GetText in ListView works in 32 bits but not on 64 bits!


 Share

Recommended Posts

Hello I'm a .Net C# Developer.

I use in my code on my PC Windows 7 32 bits this line:

string text = au3.ControlListView(windowTitle, "", "SysListView321", "GetText", "1", "");

I receive a correct result

but on my second PC Windows 7 64 bits, the same line give me a blank result ?? I touch anything, I open the same project but on two different machines (32 bits and 64 bits), on 32 bits, I've installed 32 bits version of AutoIT, and on 64 bits version 64 bits.

If I install 32 bits version on Windows 7 64 bits, my script crash

Do you plan a new version or a Beta version correct this ?

Thanks for your good job

David

Link to comment
Share on other sites

From the help-file for the function ControlListView():

"Some commands may fail when using a 32-bit AutoIt process to read from a 64-bit process. Likewise commands may fail when using a 64-bit AutoIt process to read from a 32-bit process."

I guess that's not really a bug but windows internal?

Link to comment
Share on other sites

  • 1 month later...

You can write your own implementation for

string text = au3.ControlListView(windowTitle, "", "SysListView321", "GetText", "1", "");

Look at sources of _GUICtrlListView_GetItemText() and rewrite it in your language from which you now call AutoitX.

"C:\Program Files\AutoIt3\Include\GuiListView.au3"

Link to comment
Share on other sites

The only AutoIt internal way I know of is compiling your script in x64 :D... then accessing the data should be no problem.

What I did once for SSD was to write a 32bit wrapper for a script complied to 32bit AND 64bit to work in both worlds...

Global $sFilename, $iPID, $timer
 
If Not FileExists(@ScriptDir & "\SSD") Then DirCreate(@ScriptDir & "\SSD")
Global $sConfig_Path = @ScriptDir & "\SSD"
 
If @OSArch = "X86" Then
    $sFilename = $sConfig_Path & "\SSD_32bit.exe"
    FileInstall("SSD_32bit.exe", $sFilename)
Else
    $sFilename = $sConfig_Path & "\SSD_64bit.exe"
    FileInstall("SSD_64bit.exe", $sFilename)
EndIf
 
If Not FileExists($sFilename) Then _Exit("Could not extract OSArch file to" & @CRLF & @CRLF & $sFilename)
 
Run(FileGetShortName($sFilename) & " " & $CmdLineRaw, $sConfig_Path)
 
Func _Exit($sMsg = "")
    If $sMsg Then MsgBox(16 + 262144, "SSD Install Error", $sMsg)
    Exit
EndFunc   ;==>_Exit
Edited by KaFu
Link to comment
Share on other sites

Im an currently working with a script doing this exact thing that you are asking and it works fine for 32bit and 64bit, (Obviously a 64bit compiled exe wont work on a 32bit machine)

string text = ControlListView("WindowTitle", "", "SysListView321", "GetText", "1", "") should work with no issues - I run this exact line of code on 32bit and 64bit machines all day long

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...