Jump to content



Photo

TLBAutoEnum.au3 - auto-import of COM constants (enums)


  • Please log in to reply
2 replies to this topic

#1 doudou

doudou

    reverse engineer, the evil twin of the obverse decomposer

  • Active Members
  • PipPipPipPipPipPip
  • 335 posts

Posted 05 August 2010 - 12:27 AM

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.

Requirements

Attached Files


Edited by doudou, 05 August 2010 - 06:05 PM.

UDFS:Apps:Coder's last words before final release: WE APOLOGIZE FOR INCONVENIENCE







#2 ValeryVal

ValeryVal

    Dig the way

  • Active Members
  • PipPipPipPipPipPip
  • 422 posts

Posted 05 August 2010 - 12:46 PM

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)

:blink:

Thank you.
The point of world view

#3 doudou

doudou

    reverse engineer, the evil twin of the obverse decomposer

  • Active Members
  • PipPipPipPipPipPip
  • 335 posts

Posted 05 August 2010 - 06:08 PM

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:Coder's last words before final release: WE APOLOGIZE FOR INCONVENIENCE




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users