Jump to content
Sign in to follow this  
xavierh

_GUICtrlListViewGetItemText fails under Vindows 2008 R1

Recommended Posts

xavierh

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

Share this post


Link to post
Share on other sites
PsaltyDS

Would you be using x64 version? See BugTrac #1816

This is supposed to be fixed in the current Beta 3.3.7.2. Please try it with the Beta and report your results.

:huh2:


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

Share this post


Link to post
Share on other sites
xavierh

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

Share this post


Link to post
Share on other sites
PsaltyDS

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:


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

Share this post


Link to post
Share on other sites
xavierh

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:

Share this post


Link to post
Share on other sites
xavierh

You're right, it's working correctly now :huh2:

Thank you, PsaltyDS!

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.