doudou Posted August 5, 2010 Share Posted August 5, 2010 (edited) TLBAutoEnum is an extension UDF for TLIDirect.au3. It allows to use constants defined in COM type libraries as if they were declared in your script. Little example: #include "TLBAutoEnum.au3" _AutoItObject_Startup() Dim $objFSO = ObjCreate("Scripting.FileSystemObject") ; here constants are imported and declared _TLBAutoEnum_ImportRelated($objFSO) ; here we use them just like native Dim $objFile = $objFSO.OpenTextFile(@ScriptFullPath, $IOMode.ForReading, False, $Tristate.TristateUseDefault) ; do something with the file ;... $objFile.Close() This UDF offers also possibility to import constants by name, import using multiple type libraries identified by path or GUID - for examples s. attached Usg_TLBAutoEnum.au3. Note: TLBAutoEnum is now integrated with TLI.au3, please download it there. Requirements AutoItObject Edited April 10, 2022 by doudou Files moved to TLI.au3 project mLipok 1 UDFS & Apps: Spoiler DDEML.au3 - DDE Client + ServerLocalization.au3 - localize your scriptsTLI.au3 - type information on COM objects (TLBINF emulation)TLBAutoEnum.au3 - auto-import of COM constants (enums)AU3Automation - export AU3 scripts via COM interfacesTypeLibInspector - OleView was yesterday Coder's last words before final release: WE APOLOGIZE FOR INCONVENIENCE Link to comment Share on other sites More sharing options...
ValeryVal Posted August 5, 2010 Share Posted August 5, 2010 It allows to use constants defined in COM type libraries as if they were declared in your script.Nice. Maybe it would be better to open existing file by this line: Dim $objFile = $objFSO.OpenTextFile("TLBAutoEnum.au3", $IOMode.ForReading, False, $Tristate.TristateUseDefault) Thank you. The point of world view Link to comment Share on other sites More sharing options...
doudou Posted August 5, 2010 Author Share Posted August 5, 2010 Maybe it would be better to open existing file by this line: Dim $objFile = $objFSO.OpenTextFile("TLBAutoEnum.au3", $IOMode.ForReading, False, $Tristate.TristateUseDefault) Thx, valid point, I keep forgetting that people could try to run the sample unchanged. I better take @ScriptFullPath though. UDFS & Apps: Spoiler DDEML.au3 - DDE Client + ServerLocalization.au3 - localize your scriptsTLI.au3 - type information on COM objects (TLBINF emulation)TLBAutoEnum.au3 - auto-import of COM constants (enums)AU3Automation - export AU3 scripts via COM interfacesTypeLibInspector - OleView was yesterday Coder's last words before final release: WE APOLOGIZE FOR INCONVENIENCE Link to comment Share on other sites More sharing options...
ds2kx Posted November 27, 2014 Share Posted November 27, 2014 Hi, I try to use objects and specialy the constants (enums) on TLB file of object loaded or created in AutoIt but i have always the same error. I have tested many different version of Autoit since 3.3.2 to 3.3.12, many different version of Autoitobject but no chance... I have put TLIdirect (and TLI also) and Autoitobject UDF on my project but when i test your little exemple, i have always the same error. #include "TLBAutoEnum.au3" _AutoItObject_Startup() Dim $objFSO = ObjCreate("Scripting.FileSystemObject") ; here constants are imported and declared _TLBAutoEnum_ImportRelated($objFSO) ; here we use them just like native Dim $objFile = $objFSO.OpenTextFile(@ScriptFullPath, $IOMode.ForReading, False, $Tristate.TristateUseDefault) ; do something with the file ;... $objFile.Close() Anyone can help me please ? Thank you very much. error => http://www.imagesup.net/?di=1141711012916 Link to comment Share on other sites More sharing options...
ValeryVal Posted November 28, 2014 Share Posted November 28, 2014 Hi, I try to use objects and specialy the constants (enums) on TLB file of object loaded or created in AutoIt but i have always the same error. I have tested many different version of Autoit since 3.3.2 to 3.3.12, many different version of Autoitobject but no chance... I have put TLIdirect (and TLI also) and Autoitobject UDF on my project but when i test your little exemple, i have always the same error. #include "TLBAutoEnum.au3" _AutoItObject_Startup() Dim $objFSO = ObjCreate("Scripting.FileSystemObject") ; here constants are imported and declared _TLBAutoEnum_ImportRelated($objFSO) ; here we use them just like native Dim $objFile = $objFSO.OpenTextFile(@ScriptFullPath, $IOMode.ForReading, False, $Tristate.TristateUseDefault) ; do something with the file ;... $objFile.Close() Anyone can help me please ? Thank you very much. error => http://www.imagesup.net/?di=1141711012916 This example is working for me. Matter in SciTE. Try script outside it. #include "TLBAutoEnum.au3" _AutoItObject_Startup() Dim $objFSO = ObjCreate("Scripting.FileSystemObject") ; here constants are imported and declared _TLBAutoEnum_ImportRelated($objFSO) ; here we use them just like native Dim $objFile = $objFSO.OpenTextFile(@ScriptFullPath, $IOMode.ForReading, False, $Tristate.TristateUseDefault) If IsObj($objFile) then MsgBox(0,"","$objFile is Ok!") endif $objFile.Close() The point of world view Link to comment Share on other sites More sharing options...
ds2kx Posted November 28, 2014 Share Posted November 28, 2014 This example is working for me. Matter in SciTE. Try script outside it. #include "TLBAutoEnum.au3" _AutoItObject_Startup() Dim $objFSO = ObjCreate("Scripting.FileSystemObject") ; here constants are imported and declared _TLBAutoEnum_ImportRelated($objFSO) ; here we use them just like native Dim $objFile = $objFSO.OpenTextFile(@ScriptFullPath, $IOMode.ForReading, False, $Tristate.TristateUseDefault) If IsObj($objFile) then MsgBox(0,"","$objFile is Ok!") endif $objFile.Close() Hi, Same error when i launch directly the script . Anyone can help me plz ? Thanks Link to comment Share on other sites More sharing options...
doudou Posted February 16, 2015 Author Share Posted February 16, 2015 ...Same error when i launch directly the script ... Sorry for late answer: this forum doesn't allow permanent subscriptions and I have no time for monitoring all topics. What was exactly your problem? Did you solve it? UDFS & Apps: Spoiler DDEML.au3 - DDE Client + ServerLocalization.au3 - localize your scriptsTLI.au3 - type information on COM objects (TLBINF emulation)TLBAutoEnum.au3 - auto-import of COM constants (enums)AU3Automation - export AU3 scripts via COM interfacesTypeLibInspector - OleView was yesterday Coder's last words before final release: WE APOLOGIZE FOR INCONVENIENCE 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