Sign in to follow this  
Followers 0
oleg

Object Event

5 posts in this topic

Hi im trying to create an error handling for unrar ocx object :think: for some reason i always fail :(

There is two events RarFileChange and Progression for some reason i cant get them trigger a function and get operation progress or file processed :)

Here is description of ocx control

Subs : - Lister(Fichier as String) : Lists all the files in the archive.

- Decompress(Fichier As String, Rep As String, Optional Password As String) : Extracts all the files of the archive !

Events :- RarFileChange(FichierEnCours as RarFile) : Pops up each time another file is processed in the archive.

- Progression(pourcent as integer) : Pops up each time the operation's progression changes.

Parameters : - Fichier : File to process with complete path and extension !

- Rep : Folder to decompress the archive in. (Created if necessary)

- Password : need explanations ?

- FichierEnCours : File being processed within the archive.

- pourcent : Percentage of the operation's completion.

RarFile properties : - NomArchive : Name of the archive (file name with complete path)

- NomFichier : File being processed with complete path

- Flags : File flags

- TailleCompressee : File size compressed

- TailleDecompressee : File size uncompressed

- CRCFichier : File's CRC


There is a hex ( 31303030303030 ) reasons i love AutoIt !

Share this post


Link to post
Share on other sites



Well, I don't know if this will help you a whole lot, but try something like this

$objErr = ObjEvent("AutoIt.Error","MyErrFunc")
Func MyErrFunc()

$hexnum=hex($objErr.number,8)

Msgbox(0,"","We intercepted a COM Error!!"      & @CRLF                & @CRLF & _
             "err.description is: " & $objErr.description   & @CRLF & _
             "err.windescription is: " & $objErr.windescription & @CRLF & _
             "err.lastdllerror is: "   & $objErr.lastdllerror   & @CRLF & _
             "err.scriptline is: "   & $objErr.scriptline    & @CRLF & _
             "err.number is: "       & $hexnum               & @CRLF & _
             "err.source is: "       & $objErr.source        & @CRLF & _
             "err.helpfile is: "       & $objErr.helpfile      & @CRLF & _
             "err.helpcontext is: " & $objErr.helpcontext _
            )
exit
EndFunc

~cdkid


AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!

Share this post


Link to post
Share on other sites

Well this handles com errors but i need to handle this specific ocx Events ( Progression,RarFileChange) i need to catch them so i can update progress or see what file is being processed :( My head is going to blow :think:


There is a hex ( 31303030303030 ) reasons i love AutoIt !

Share this post


Link to post
Share on other sites

Anyone ?


There is a hex ( 31303030303030 ) reasons i love AutoIt !

Share this post


Link to post
Share on other sites

This may or may not work (I'm not a COM wizard)

$events = ObjEvent($YourComObjectVariable,"MyErrFunc_")
Func MyErrFunc_RarFileChange($var)

MsgBox(0,'','The RAR File changed to ' & $var)
EndFunc

~cdkid


AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!

Share this post


Link to post
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
Sign in to follow this  
Followers 0