HeyMister Posted June 29, 2008 Share Posted June 29, 2008 First, global replace &_ with & _Then, on line 1 the RunErrorsFatal flag has been removed in favor of an @error setting. I haven't written an error handler yet.Right now, it just fails without report. I don't know how much farther I'm going to precede with debugging this.Just FYI. Link to comment Share on other sites More sharing options...
MHz Posted July 1, 2008 Share Posted July 1, 2008 Here is an example of retrieving the error message from an execution using Run().; run a file that does not exist to produce errorRun('I-do-not-exist.exe'); check error statusIf @error And @extended Then ; get the error message $message = _FormatMessage(@extended) If Not @error Then ; show the error message MsgBox(0, Default, $message) EndIfEndIfFunc _FormatMessage($iErrorcode) ; Finds the message definition in a message table resource Local $lpBuffer, $sMessage Local Const $FORMAT_MESSAGE_FROM_SYSTEM = 0x1000 $lpBuffer = DllStructCreate('char[4096]') If @error Then Return SetError(1, 0, '') DllCall('kernel32.dll', 'int', 'FormatMessage', _ 'int', $FORMAT_MESSAGE_FROM_SYSTEM, _ 'ptr', 0, _ 'int', $iErrorcode, _ 'int', 0, _ 'ptr', DllStructGetPtr($lpBuffer), _ 'int', 4096, _ 'ptr', 0) If Not @error Then $sMessage = DllStructGetData($lpBuffer, 1) $lpBuffer = 0 Return $sMessage Else $lpBuffer = 0 Return SetError(2, 0, '') EndIfEndFunc Link to comment Share on other sites More sharing options...
HeyMister Posted July 1, 2008 Author Share Posted July 1, 2008 MHz,Thank you! I had set the problem aside. This addresses my biggest stumbling block. 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