Jump to content

Recommended Posts

Posted

What I'm trying to do:

in an window with caption starting with "PrintStation Manager - [", in a listview that display print jobs, I need to select items where subitem 1 contains text, the print job names.

The text of items to select is passed in as a CRLF-separated buffer.

Code section:

#Include <GuiListView.au3>

;...

Dim $hwnd = ControlGetHandle ( "PrintStation Manager - [", "", "[CLASS:SysListView32; INSTANCE:1]" )

Dim $arJobs = StringSplit ( $JobList, @CRLF, 1 )

Dim $Index

for $i = 1 to $arJobs [ 0 ]

$Index = _GuiCtrlListview_FindInText ( $hwnd, $arJobs [ $i ])

if $Index > -1 Then

MsgBox(0,"","found " & $arJobs [ $i ])

_GUICtrlListView_SetItemSelected ($hwnd, $Index)

Else

MsgBox(0,"",$arJobs [ $i ] & " was not found in the print job list")

EndIf

Next

This works fine under XP.

Under Windows 2008 R1, the text could not be found. So I placed the GuiListView.au3 in my main file and added messageboxes. As it turns out, the problem happens in _GUICtrlListView_GetItemText. The statement DllStructGetData($tBuffer, "Text") returns nothing. The "If IsHWnd($hWnd) " condition is true, and _WinAPI_InProcess($hWnd, $_lv_ghLastWnd) returns false, which makes sense since I'm trying to control another process.

The message boxes are only included in the code to track down what it going on.

I have compiled to exe and run it as administrator, but no luck there either.

Any ideas?

Thanks,

Xavier

Posted

You're right, it seems to be a 64 bit problem. It fails in the same way under windows 7 64 bits.

I installed the 3.3.7.7 beta patch.

Using the scitech editor, it still fails if I use Tools>Beta Run, and the exe I buid using Tools>Beta Compile also fails.

If I use the Beta\Aut2exe.exe to generate an exe, it also fails.

But if I use the "C:\Program Files (x86)\AutoIt3\Beta\AutoIt3.exe" to run the script, it now works fine.

Is there a way to produce a working exe?

Thanks,

Xavier

Posted

Explicitly tell it which architecture you intend to use with one of the following:

#AutoIt3Wrapper_UseX64=N ; 32 bit

; --- or

#AutoIt3Wrapper_UseX64=Y ; x64 bit

:huh2:

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
×
×
  • Create New...