Sign in to follow this  
Followers 0
oleg

Com Object Errors

4 posts in this topic

#1 ·  Posted (edited)

Im trying out some Activex Zip objects and for most of them i have autoit crashing :think: All operation is completed sucessfully by Object but when it finishes Autoit crashes ...Here is some code

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc") ; Install a custom error handler

$objZip = ObjCreate("ChilkatZip2.ChilkatZip2")

$objZipEvent = ObjEvent($objZip,"Event")

if Isobj($objZip) Then

$objZip.UnlockComponent("AnythingWorksFor30DayTrial")

$objZip.OpenZip("c:\test.zip")

$objZip.Unzip("c:\")

Else

MsgBox(016,"Error","Unrar.Ocx Is Not Registered")

EndIf

Func Event()

ConsoleWrite($objZip.LastErrorText)

EndFunc

Func MyErrFunc()

$HexNumber=hex($oMyError.number,8)

Msgbox(0,"","We intercepted a COM Error !" & @CRLF & _

"Number is: " & $HexNumber & @CRLF & _

"Windescription is: " & $oMyError.windescription )

SetError(1) ; something to check for when this function returns

Endfunc

Autoit Crash oleaut32.dll lib.

Edited by oleg

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

Share this post


Link to post
Share on other sites



Well, I see one problem with your Event function... try actually reading the helpfile on ObjEvent.


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

Thanks :think: Seems that i wasnt been handling events correctly :) I will try to figure it out :(


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

Share this post


Link to post
Share on other sites

:think: I modified the code but still its crashes .

Im able to have the interface return correctly but still

here is the code

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc") ; Install a custom error handler

$objZip = ObjCreate("ChilkatZip2.ChilkatZip2")

$objZipEvent = ObjEvent($objZip,"Event_","_IChilkatZip2Events")

if Isobj($objZip) Then

;$objZip.EnableEvents = "true"

$objZip.UnlockComponent("AnythingWorksFor30DayTrial")

$objZip.OpenZip("c:\test.zip")

$objZip.Unzip("c:\")

Else

MsgBox(016,"Error","ChilkatZip Activex Is Not Registered")

EndIf

Func Event_UnzipPercentDone($val1,$val2)

ConsoleWrite($val1&@CRLF)

EndFunc

Func Event_UnzipBegin()

$objZip.NewZip

MsgBox(0,"","Finished")

EndFunc

Func MyErrFunc()

$HexNumber=hex($oMyError.number,8)

Msgbox(0,"","We intercepted a COM Error !" & @CRLF & _

"Number is: " & $HexNumber & @CRLF & _

"Windescription is: " & $oMyError.windescription )

SetError(1) ; something to check for when this function returns

Endfunc

What do you think ?


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

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