xavierh Posted May 26, 2011 Share Posted May 26, 2011 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 Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 27, 2011 Share Posted May 27, 2011 Would you be using x64 version? See BugTrac #1816This is supposed to be fixed in the current Beta 3.3.7.2. Please try it with the Beta and report your results. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
xavierh Posted May 31, 2011 Author Share Posted May 31, 2011 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 Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 31, 2011 Share Posted May 31, 2011 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 Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
xavierh Posted May 31, 2011 Author Share Posted May 31, 2011 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 Link to comment Share on other sites More sharing options...
xavierh Posted May 31, 2011 Author Share Posted May 31, 2011 You're right, it's working correctly now Thank you, PsaltyDS! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now