Jump to content

Error Handler ?


Recommended Posts

Dear Sir

my script looks like ..

...

_IEErrorHandlerRegister ()

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")

...

but i always got a warnning like ...

-----------------------------------------------------------

--> COM Error Encountered in xxxxx.au3

----> $IEComErrorScriptline = 20

----> $IEComErrorNumberHex = 00000002

----> $IEComErrorNumber = 2

----> $IEComErrorWinDescription = Can't install a new Errorhandler when one is still active.

----> $IEComErrorDescription =

----> $IEComErrorSource =

----> $IEComErrorHelpFile =

----> $IEComErrorHelpContext =

----> $IEComErrorLastDllError = 0

-------------------------------------------------------------

and

when i removed the line

_IEErrorHandlerRegister ()

i got the com error always when running any _IE prefix function

what should i do ?

thanks :P

Link to comment
Share on other sites

IE.au3 already uses a COM error handler, you are trying to re-register it improperly with your own. According to the help file, if you want to use your own you need to use,

_IEErrorHandlerRegister ("MyErrFunc")

not

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")

I could be wrong but if this isn't the problem can you post your code?

While ProcessExists('Andrews bad day.exe')
	BlockInput(1)
	SoundPlay('Music.wav')
	SoundSetWaveVolume('Louder')
WEnd
Link to comment
Share on other sites

@someone - you are correct.

This requirement and the reasons behind it are explained in detail in the helpfile with _IEErrorHandlerRegister()

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

IE.au3 already uses a COM error handler, you are trying to re-register it improperly with your own. According to the help file, if you want to use your own you need to use,

_IEErrorHandlerRegister ("MyErrFunc")

not

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")

I could be wrong but if this isn't the problem can you post your code?

..................................................................................

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")

is lined for the

global $oHTTP = ObjCreate("winhttp.winhttprequest.5.1")

and

local $oTranslate = ObjCreate("adodb.stream")

....................................................................................

the help file said that is needed when some COM object in your code .

what should i do ? remove all them ?

------------------------------------------------------------

sorry @someone , for misunderstanding your meaning !

Edited by BigDog
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...