Administrators Jon Posted May 10, 2008 Administrators Posted May 10, 2008 In v3.2.12.0 a number of changes were made to the include files used for the GUI:GUIConstants.au3 is identical to GUIConstantsEx.au3. This means that many scripts using advanced GUI functionality will need to use additional #include statements to include files containing constants that were previously and erroneously included.GUIDefaultConstants.au3 no longer exists. You must now #include the corresponding individual constants file for the control type you need.Needs some more detail, and maybe a step by step guide of how to convert a couple of scripts - please reply to this thread with suggestions/drafts of how this post should look and I'll update. This is to help with the inevitable flood of questions when 3.2.12.0 is released. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/
Administrators Jon Posted May 10, 2008 Author Administrators Posted May 10, 2008 Discuss. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/
monoceres Posted May 10, 2008 Posted May 10, 2008 I just made a small "updater" which will search through your scripts and add appropriate includes. Feel free to change it since it's not very optimized and it could have some problems (Tested on one of my old projects with 400+ lines and worked flawless though) #include <Array.au3> #include <File.au3> $script=FileOpenDialog("Choose script that will be fixed",@ScriptDir,"au3 (*.au3)") $autoitdir=FileSelectFolder("Autoit Include folder","") If $autoitdir="" Then Exit If $script="" Then Exit Global $includelines, $scriptdata Global $includestoadd[1], $count=0 $scriptdata=FileRead($script) $includes=_FileListToArray($autoitdir,"*Constants*.au3") For $i=1 To Ubound($includes)-1 _FileReadToArray($autoitdir&"\"&$includes[$i],$includelines) For $j=1 To Ubound($includelines)-1 If StringLeft($includelines[$j],12)="Global Const" Then $const=StringMid($includelines[$j],StringInStr($includelines[$j],"$"),StringInStr($includelines[$j],'=')-StringInStr($includelines[$j],"$")-1) If StringInStr($scriptdata,$const) Then _ArrayAdd($includestoadd,$includes[$i]) ExitLoop EndIf EndIf Next Next For $a=1 To UBound($includestoadd)-1 If StringInStr($scriptdata,"#include <"&$includestoadd[$a]&">")=0 And StringInStr($scriptdata,"#include<"&$includestoadd[$a]&">")=0 And $includestoadd[$a]<>"GUIConstants.au3" Then _FileWriteToLine($script,1,"#include <"&$includestoadd[$a]&">") $count+=1 EndIf Next MsgBox(0,"Result",$count&" include(s) were added") Broken link? PM me and I'll send you the file!
Zedna Posted May 10, 2008 Posted May 10, 2008 (edited) Very handy tool for this migration process is Organize Includes from Xenobiologist Link: http://www.autoitscript.com/forum/index.php?showtopic=55368 Edited May 10, 2008 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
GEOSoft Posted May 16, 2008 Posted May 16, 2008 Very handy tool for this migration process is Organize Includes from Xenobiologist Link: http://www.autoitscript.com/forum/index.php?showtopic=55368Too bad that doesn't work without Scite. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
MattX Posted May 16, 2008 Posted May 16, 2008 Odd why now lines in a script of mine like this: ( problem lies around $icon16= ) #include <GUIConstantsEx.au3> $Form1 = GUICreate("Edugeek's Admin's Admin Bar 1.7.1", 465, 160, 64, 34) $helpmenu = GUICtrlCreateMenu("Help") $support_sites_menu = GUICtrlCreateMenu("Support Sites") $infoitem = GUICtrlCreateMenuItem("About", $helpmenu) $infoitem2 = GUICtrlCreateMenuItem("Support Sites", $support_sites_menu) GUISetBkColor(0x0066FF) $Icon16 = GUICtrlCreateIcon(@SystemDir & "\eventvwr.exe", 0, 380, 7, 32, 32, BitOR($SS_NOTIFY, $WS_GROUP)) GUICtrlCreateLabel("Event", 381, 35) GUICtrlCreateLabel("Viewer", 381, 48) GUICtrlSetTip(-1, "Launch Event Viewer") Is showing errors: C:\COOL\test.au3(10,94) : WARNING: $SS_NOTIFY: possibly used before declaration. $Icon16 = GUICtrlCreateIcon(@SystemDir & "\eventvwr.exe", 0, 380, 7, 32, 32, BitOR($SS_NOTIFY, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\COOL\test.au3(10,105) : WARNING: $WS_GROUP: possibly used before declaration. $Icon16 = GUICtrlCreateIcon(@SystemDir & "\eventvwr.exe", 0, 380, 7, 32, 32, BitOR($SS_NOTIFY, $WS_GROUP) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~^ C:\COOL\test.au3(10,94) : ERROR: $SS_NOTIFY: undeclared global variable. $Icon16 = GUICtrlCreateIcon(@SystemDir & "\eventvwr.exe", 0, 380, 7, 32, 32, BitOR($SS_NOTIFY, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\COOL\test.au3 - 1 error(s), 2 warning(s) I have put in the new #include <GUIConstantsEx.au3> but why the variable errors when it worked ok before ?
monoceres Posted May 17, 2008 Posted May 17, 2008 You need additional constants, please test my script above Broken link? PM me and I'll send you the file!
MattX Posted May 17, 2008 Posted May 17, 2008 You need additional constants, please test my script above I ran your excellent script against mine and it stated it didn't need any additional constants...
i542 Posted May 17, 2008 Posted May 17, 2008 You need to add #include <WindowsConstants.au3> I can do signature me.
monoceres Posted May 17, 2008 Posted May 17, 2008 You also need: #include <StaticConstants.au3> Ps. tested fixing your script with my script, it worked fine. Sure you specified the include folder in the autoit folder? Broken link? PM me and I'll send you the file!
1bobby Posted May 19, 2008 Posted May 19, 2008 In v3.2.12.0 a number of changes were made to the include files used for the GUI:GUIConstants.au3 is identical to GUIConstantsEx.au3. This means that many scripts using advanced GUI functionality will need to use additional #include statements to include files containing constants that were previously and erroneously included.GUIDefaultConstants.au3 no longer exists. You must now #include the corresponding individual constants file for the control type you need.Needs some more detail, and maybe a step by step guide of how to convert a couple of scripts - please reply to this thread with suggestions/drafts of how this post should look and I'll update. This is to help with the inevitable flood of questions when 3.2.12.0 is released.
1bobby Posted May 19, 2008 Posted May 19, 2008 Monoceres, that is a GREAT script, once I figured it out. Love it. Ran two scripts and it sure bailed me out. Wish I could think that fast, but it works great. Thanks for your efforts for us new kids on the block. bobby You the coder!
monoceres Posted May 19, 2008 Posted May 19, 2008 Monoceres, that is a GREAT script, once I figured it out. Love it. Ran two scripts and it sure bailed me out. Wish I could think that fast, but it works great. Thanks for your efforts for us new kids on the block. bobby You the coder!Thanks It sure has helped me out a lot as well Broken link? PM me and I'll send you the file!
mdwerne Posted May 20, 2008 Posted May 20, 2008 Hello, Not 100% sure this is relative to this post, but my problem has cropped up since switching to 3.2.12 and I am getting similar errors. C:\Documents and Settings\mdwerne\Desktop\AutoIt Scripts\PrevMaintLite\Test.au3(8,119) : WARNING: $STDOUT_CHILD: possibly used before declaration. $dsqOut = Run(@ComSpec & " /c dsquery computer domainroot -name " & @ComputerName, @SystemDir, @SW_HIDE, $STDOUT_CHILD) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\mdwerne\Desktop\AutoIt Scripts\PrevMaintLite\Test.au3(8,119) : ERROR: $STDOUT_CHILD: undeclared global variable. $dsqOut = Run(@ComSpec & " /c dsquery computer domainroot -name " & @ComputerName, @SystemDir, @SW_HIDE, $STDOUT_CHILD) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\mdwerne\Desktop\AutoIt Scripts\PrevMaintLite\Test.au3 - 1 error(s), 1 warning(s) I added all the includes below, and while my error above went away (by adding constants.au3), my dsquery is now blank. Any thoughts? Thanks, Mike P.S. If it's not obvious, I'm still pretty new to scripting with AutoIt. Slowly trying to get better. ;#include <constants.au3> #include <GUIConstants.au3> ;#include <GUIConstantsEx.au3> ;#include <WindowsConstants.au3> ;#include <StaticConstants.au3> Global $dsqOut, $OU $dsqOut = Run(@ComSpec & " /c dsquery computer domainroot -name " & @ComputerName, @SystemDir, @SW_HIDE, $STDOUT_CHILD) $OU = StdoutRead($dsqOut) GUICreate("PML ", 500, 400) $GROUP_1 = GUICtrlCreateGroup("Computer", 15, 10, 475, 157) $LABEL_1 = GUICtrlCreateLabel("Computer Name:", 25, 30, 80, 20) $INPUT_1 = GUICtrlCreateInput(@ComputerName, 110, 25, 75, 20) $INPUT_2 = GUICtrlCreateInput($OU, 25, 95, 450, 20) $Quit = GUICtrlCreateButton("Quit", 100, 300, 60, 50) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Quit ExitLoop EndSelect WEnd
GEOSoft Posted May 20, 2008 Posted May 20, 2008 Change $STDOUT_CHILD to 2 George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
mdwerne Posted May 20, 2008 Posted May 20, 2008 Change $STDOUT_CHILD to 2Thank you, that resolved the error I was getting without having constants.au3 included.But for some reason my dsquery still comes up blank?From a command line I'm getting a result, but for some reason the query is not making it back into the script. $INPUT_2 is blank.Again, thank you for the optional handle to $STDOUT_CHILD.-Mike
mdwerne Posted May 20, 2008 Posted May 20, 2008 Thank you, that resolved the error I was getting without having constants.au3 included.But for some reason my dsquery still comes up blank?From a command line I'm getting a result, but for some reason the query is not making it back into the script. $INPUT_2 is blank.Again, thank you for the optional handle to $STDOUT_CHILD.-MikeProblem resolved!!!After searching the forums I found this answer by Valik: http://www.autoitscript.com/forum/index.php?showtopic=16098Bottomline, I added "ProcessWaitClose($dsqOut)" and all is well again. Not sure why 3.2.10 worked and 3.2 12 didn't, but oh well. It' s fixed.-Mike
Andy007 Posted May 20, 2008 Posted May 20, 2008 (edited) Hi All, Newbie alert... I installed v3.2.10.0 the other day and then noticed the newer version, so installed that (removing the old one first). I was able to run the clock.au3 (C:\Program Files\AutoIt3\Examples\GUI\Advanced\Clock.au3) in previous version but not now. Can someone tell me how to make the changes to get it to work. I want to show the boss some of the things that can be done... Any help will be appreciated. Edited May 20, 2008 by Andy007 Regards,Andy (no, the other one)
mdwerne Posted May 21, 2008 Posted May 21, 2008 Hi All,Newbie alert...I installed v3.2.10.0 the other day and then noticed the newer version, so installed that (removing the old one first).I was able to run the clock.au3 (C:\Program Files\AutoIt3\Examples\GUI\Advanced\Clock.au3) in previous version but not now.Can someone tell me how to make the changes to get it to work. I want to show the boss some of the things that can be done...Any help will be appreciated. As I am in the noob boat too, take my suggestion with a grain of salt.I added this:#include <WindowsConstants.au3>and commented out this:;Global Const $ULW_ALPHA = 2Works for me!-Mike
Andy007 Posted May 21, 2008 Posted May 21, 2008 Thanks Mike. That worked. I just assumed it should have been fine in the first place being a sample au3 script that was installed during the setup. Regards,Andy (no, the other one)
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