Undutchable Posted September 15, 2008 Share Posted September 15, 2008 Hello, I have searched the forums and help file but still couldn't find an answer. How can I have a description for the error code returned by @extended ? I'm using the function DriveMapAdd() and, when an error occurs, I would like to inform the user the actual problem and not the error code. For example 53 = Bad Network Path. Of course I can document every one but that is one heck of a task Any sugestions ? Thanks in advance. Link to comment Share on other sites More sharing options...
Szhlopp Posted September 15, 2008 Share Posted September 15, 2008 Hello, I have searched the forums and help file but still couldn't find an answer. How can I have a description for the error code returned by @extended ? I'm using the function DriveMapAdd() and, when an error occurs, I would like to inform the user the actual problem and not the error code. For example 53 = Bad Network Path. Of course I can document every one but that is one heck of a task >_< Any sugestions ? Thanks in advance. Only way is to document the messages Just do something like this: $Ext = @extended $Error = "" If $Ext = 1 Then $Error = "BLA" ElseIf $Ext = 2 Then $Error = "Different BLA" EndIf MsgBox(0, "", $Error) RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+' Link to comment Share on other sites More sharing options...
Undutchable Posted September 15, 2008 Author Share Posted September 15, 2008 Damn! Well.. better get started.. Thanks Szhlopp Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 15, 2008 Share Posted September 15, 2008 Hello, I have searched the forums and help file but still couldn't find an answer. How can I have a description for the error code returned by @extended ? I'm using the function DriveMapAdd() and, when an error occurs, I would like to inform the user the actual problem and not the error code. For example 53 = Bad Network Path. Of course I can document every one but that is one heck of a task Any sugestions ? Thanks in advance. Try this, adapted from _WinAPI_GetLastErrorMessage(): #include <WinAPI.au3> $n = 53; Error code MsgBox(64, "Test", _WinAPI_GetErrorMessage($n)) Func _WinAPI_GetErrorMessage($iErrorNum) Local $tText $tText = DllStructCreate("char Text[4096]") _WinAPI_FormatMessage($__WINAPCONSTANT_FORMAT_MESSAGE_FROM_SYSTEM, 0, $iErrorNum, 0, DllStructGetPtr($tText), 4096, 0) Return DllStructGetData($tText, "Text") EndFunc ;==>_WinAPI_GetErrorMessage >_< Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Undutchable Posted September 16, 2008 Author Share Posted September 16, 2008 Awesome! It's perfect. Thanks PsaltyDS! 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