tellme Posted August 26, 2021 Share Posted August 26, 2021 (edited) Hi, im using #include "_ImageSearch_UDF.au3" this but i have to use; #include <GuiListView.au3> this as well, but when i include both in, im getting error as; C:\Program Files (x86)\AutoIt3\Include\SecurityConstants.au3"(63,30) : error: $TOKENPRIMARY previously declared as a 'Const' So to be able to run Script i have to delete one of the #include, is there anyway to solve this? i have to include both like; #RequireAdmin #include "_ImageSearch_UDF.au3" #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ListViewConstants.au3> #include <MsgBoxConstants.au3> #include <GuiListView.au3> <GuiListView.au3> gives this error. thank you. Edited August 26, 2021 by tellme Link to comment Share on other sites More sharing options...
Solution Danp2 Posted August 26, 2021 Solution Share Posted August 26, 2021 It appears that these lines are copied from SecurityConstants.au3 -- Global Enum $TOKENPRIMARY = 1, $TOKENIMPERSONATION Global Enum $SECURITYANONYMOUS = 0, $SECURITYIDENTIFICATION, $SECURITYIMPERSONATION, $SECURITYDELEGATION You can comment them out in the ImageSearch UDF, but then you will likely need to #include SecurityConstants.au3 tellme 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
tellme Posted August 26, 2021 Author Share Posted August 26, 2021 Yep, that did worked. Thanks alot. Link to comment Share on other sites More sharing options...
Musashi Posted August 26, 2021 Share Posted August 26, 2021 Another option would be to rename the constants within _ImageSearch_UDF.au3 Global Enum $_TOKENIMPERSONATION, $_SECURITYIMPERSONATION Only these two are used in the #Region #INTERNAL_USE_ONLY ; #INTERNAL_USE_ONLY#============================================================================================================ #Region #INTERNAL_USE_ONLY [...] Func _CanAccessFolder($sDir, $genericAccessRights = 0x40000000) [...] Local $hImpersonatedToken = _ImageSearchDLL_DuplicateTokenEx($hToken, 0, $_SECURITYIMPERSONATION, $_TOKENIMPERSONATION) [...] It is then no longer a requirement to include the SecurityConstants.au3. "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." 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