Jump to content

ListView Error


 Share

Recommended Posts

I am getting an error in my script. It points to a $GUI_SS_DEFAULT_LISTVIEW error and states it is possibly used before declaration. I looked at all of the include files and am not able to find a reference to the $GUI_SS_DEFAULT_LISTVIEW. Am I missing an include file perhaps? I just upgraded to the latest version if that makes a difference.

Here is the code:

CODE
#include <GUIConstants.au3>

#include "DBlistView.au3"

Opt("GUIOnEventMode", 1) ; OnEvent mode

Dim $title="Access db Viewer" ;gui title

Dim $gui = GUICreate($title, 800, 600)

GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")

$DB=@ScriptDir & "\test.mdb" ;modify to location of your .mdb //does'nt handle relationships

$Query="Select * From CompanyName Order by CompanyName ASC" ;modify your query

$Number_of_Records_to_Display = 25 ;these variables are self explanitory...

$Listview_Left = 50

$Listview_Top = 50

$Listview_Width = 400

$Listview_Height = 400

$Listview_style = $GUI_SS_DEFAULT_LISTVIEW ;default is -1

$Listview_exStyle = $LVS_EX_FULLROWSELECT + $LVS_EX_GRIDLINES ;default is -1

;call the function

_createDBlistView($DB,$Query,$Number_of_Records_to_Display,$Listview_Left,$Listview_Top,$Listview_Width,$Listview_Height,$Listview_style,$Listview_exStyle)

GUISetState ()

While 1

Sleep(1000) ; Idle around

WEnd

Thanks

CC

Link to comment
Share on other sites

Thanks for the suggestion! I always struggle when and what include in my scripts and when would they be required. I changed the script to included the ListViewConstants.au3 and still get the following error.

AutoIt3 Syntax Checker v1.54.8 Copyright © Tylo 2007

E:\access\DBlistView.au3(18,58) : WARNING: $GUI_SS_DEFAULT_LISTVIEW: possibly used before declaration.

$Listview_style = $GUI_SS_DEFAULT_LISTVIEW ;default is -1

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

The error looked a little odd in that it points to my script directory and not the AutoIt include directory in c:\Porgram Files\AutiIt\Include directory. So I changed the include from #include "DBListView.au3" to #include <DBlistView.au3>. It now looks like it is using the correct file.

Thanks for the assistance.!

CC

Edited by IvanCodin
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...