Yury Posted May 13, 2008 Share Posted May 13, 2008 Good Day, Please Help !1. I have Code:$MSCommObj = ObjCreate("MSCOMMLib.MSComm")$MSCommObj.CommPort = 3$MSCommObj.PortOpen = TrueMsgBox(0, "", "PortOpen !")2. CommPort 3 is busy different device3. I Run My Code4. I have Error in SciTE:E:\AutoIt\MyScripts.au3 (3) : ==> The requested action with this object has failed.: $MSCommObj.PortOpen = True $MSCommObj.PortOpen = True^ ERROR->17:24:41 AutoIT3.exe ended.rc:1>Exit code: 1 Time: 3.089How work with ERRORS from OSX Objects and Continue run my Code ?And I don't want to use File in VbScript with "On Error Resume Next ..." My email Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 13, 2008 Share Posted May 13, 2008 (edited) Good Day, Please Help ! 1. I have Code: $MSCommObj = ObjCreate("MSCOMMLib.MSComm") $MSCommObj.CommPort = 3 $MSCommObj.PortOpen = True MsgBox(0, "", "PortOpen !") 2. CommPort 3 is busy different device 3. I Run My Code 4. I have Error in SciTE: E:\AutoIt\MyScripts.au3 (3) : ==> The requested action with this object has failed.: $MSCommObj.PortOpen = True $MSCommObj.PortOpen = True^ ERROR ->17:24:41 AutoIT3.exe ended.rc:1 >Exit code: 1 Time: 3.089 How work with ERRORS from OSX Objects and Continue run my Code ? And I don't want to use File in VbScript with "On Error Resume Next ..." My email Include a COM error handler per the help file under COM/OBJ Reference. You might also verify your initial obj creation worked: $MSCommObj = ObjCreate("MSCOMMLib.MSComm") If IsObj($MSCommObj) Then ConsoleWrite("Debug: Created obj $MSCommObj: " & ObjName($MSCommObj) & @LF) Else MsgBox(16, "Error", "Failed to create $MSCommObj from MSCOMMLib.MSComm.") Exit EndIf Edit: Typo Edited May 13, 2008 by PsaltyDS 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...
Yury Posted May 14, 2008 Author Share Posted May 14, 2008 Include a COM error handler per the help file under COM/OBJ Reference. You might also verify your initial obj creation worked: $MSCommObj = ObjCreate("MSCOMMLib.MSComm") If IsObj($MSCommObj) Then ConsoleWrite("Debug: Created obj $MSCommObj: " & ObjName($MSCommObj) & @LF) Else MsgBox(16, "Error", "Failed to create $MSCommObj from MSCOMMLib.MSComm.") Exit EndIf Edit: TypoThank you very mach for Help ! But I d'not andestand: "Include a COM error handler per the help file under COM/OBJ Reference." What is this ? May I give Code Error for: $MSCommObj.CommPort = 3 when CommPort 3 is busy different device ? And If I Make rather like situation: Run("File.exe") when "File.exe" not exist How I can Give Code and Description of ERRROR ? Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 14, 2008 Share Posted May 14, 2008 But I d'not andestand: "Include a COM error handler per the help file under COM/OBJ Reference." What is this ?In the directory where AutoIt is installed, there is an AutoIt3.chm file. That is the help file. Open it and read the section under AutoIt, Function Reference, Obj\COM Reference. In the lower half of that section is a part labeled "COM error handling" that includes examples. 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...
Yury Posted June 4, 2008 Author Share Posted June 4, 2008 In the directory where AutoIt is installed, there is an AutoIt3.chm file. That is the help file. Open it and read the section under AutoIt, Function Reference, Obj\COM Reference. In the lower half of that section is a part labeled "COM error handling" that includes examples. Thank you very mach for your Help !I used Rissian Help File, which don't had this information!Now I solve this Problem! Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 4, 2008 Share Posted June 4, 2008 Thank you very mach for your Help !I used Rissian Help File, which don't had this information!Now I solve this Problem!You might consider working on updating it to 3.2.12.0. 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...
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