Jump to content
Shane0000

ObjGet() crashes AutoIt -1073741819

Recommended Posts

The below code  will cause AutoIt to hard crash  after 18+/- seconds with the error: -1073741819

Sometimes the method succeeds 2+/- seconds, most the time not.

I just updated to AutoCAD2016 and I am getting a high failure rate with my scripts.

Class ID of the target application is AfxMDIFrame110u

I updated SciTE to see if that would help but it did not.

 

ConsoleWrite("AutoIt Ver: " & @AutoItVersion & @CRLF)
ConsoleWrite(@OSVersion& " " & @OSArch & @CRLF)
ConsoleWrite("Build: " & @OSBuild & @CRLF)
ConsoleWrite(@OSServicePack & @CRLF)
ConsoleWrite(@OSType & @CRLF)


$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")
$oAcad = ObjGet("","AutoCAD.application")
If @error Then
    MsgBox( 0 , "" , "Failed")
    Exit
Else
    ConsoleWrite("-Line: " & @ScriptLineNumber & @CRLF & "$oAcad: " & IsObj($oAcad) & @CRLF)
EndIf





Func MyErrFunc()

; Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !"      & @CRLF  & @CRLF & _
;           "err.description is: "    & @TAB & $oMyError.description    & @CRLF & _
;          "err.windescription:"     & @TAB & $oMyError.windescription & @CRLF & _
;         "err.number is: "         & @TAB & hex($oMyError.number,8)  & @CRLF & _
;        "err.lastdllerror is: "   & @TAB & $oMyError.lastdllerror   & @CRLF & _
;       "err.scriptline is: "     & @TAB & $oMyError.scriptline     & @CRLF & _
;      "err.source is: "         & @TAB & $oMyError.source         & @CRLF & _
;     "err.helpfile is: "       & @TAB & $oMyError.helpfile       & @CRLF & _
;    "err.helpcontext is: "    & @TAB & $oMyError.helpcontext _
;  )


ConsoleWrite(@CRLF  & @CRLF & "We intercepted a COM Error !"      & @CRLF  & @CRLF & _
           "err.description is: "    & @TAB & $oMyError.description    & @CRLF & _
          "err.windescription:"     & @TAB & $oMyError.windescription & @CRLF & _
         "err.number is: "         & @TAB & hex($oMyError.number,8)  & @CRLF & _
        "err.lastdllerror is: "   & @TAB & $oMyError.lastdllerror   & @CRLF & _
       "err.scriptline is: "     & @TAB & $oMyError.scriptline     & @CRLF & _
      "err.source is: "         & @TAB & $oMyError.source         & @CRLF & _
     "err.helpfile is: "       & @TAB & $oMyError.helpfile       & @CRLF & _
    "err.helpcontext is: "    & @TAB & $oMyError.helpcontext    & @CRLF & @CRLF _
  )

    Local $err = $oMyError.number
    If $err = 0 Then $err = -1

    $g_eventerror = $err  ; to check for after this function returns
Endfunc
AutoIt Ver: 3.3.12.0
WIN_7 X64
Build: 7601
Service Pack 1
WIN32_NT
!>23:21:10 AutoIt3.exe ended.rc:-1073741819
+>23:21:10 AutoIt3Wrapper Finished.
>Exit code: 3221225477    Time: 18.86
AutoIt Ver: 3.3.12.0
WIN_7 X64
Build: 7601
Service Pack 1
WIN32_NT
-Line: 14
$oAcad: 1
+>23:23:50 AutoIt3.exe ended.rc:0
+>23:23:50 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 1.995

 

Edited by Shane0000

Share this post


Link to post
Share on other sites

Could you try with the latest beta version of AutoIt?

BTW: You are posting in the wrong forum. It's for "ActiveX and DLL versions of AutoIt".


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2019-08-19 - Version 1.4.13.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (NEW 2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

Im still getting the same output. 

AutoIt Ver: 3.3.13.20
WIN_7 X64
Build: 7601
Service Pack 1
WIN32_NT
!>10:08:24 AutoIt3.exe ended.rc:-1073741819
+>10:08:24 AutoIt3Wrapper Finished.
>Exit code: 3221225477    Time: 25.55

 

I thought lines like below were using COM

$oAcad.Layers.Item("0")

 

Share this post


Link to post
Share on other sites

Is it possible for you to test COM with Visual Basic? If it works then we know it is an AutoIt bug.

It's not about COM.
The forum is about other programs calling AutoIt.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2019-08-19 - Version 1.4.13.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (NEW 2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

From within Excel's VBA I can get the object without fail.

Sub test()
Dim oAcad As Object
Set oAcad = GetObject(, "Autocad.application")
MsgBox oAcad.activedocument.Name
End Sub

Share this post


Link to post
Share on other sites

Looks like a bug then.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2019-08-19 - Version 1.4.13.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (NEW 2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

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

  • Similar Content

    • By Rhidlor
      So I'm trying to do some as400 automation and hit a wall when trying to get a COM object. The code on line 8 is failing, the as400.ws file opens with PCSWS.exe so I tried using that as the file path too but that didn't work either. Any and all help is greatly appreciated! 
       
      $file = "C:\Users\Rhidlor\Desktop\as400.ws" If Not FileExists($file) Then MsgBox(0, "Error", "Error finding file") Exit EndIf $object = ObjGet($file) If @error Then MsgBox(0, "Error", "Error getting object") Exit EndIf $object.SendKeys("05")  
    • By nitron
      Hy All,
       
      again I got a question.
      I try to convert
      wmic PATH Win32_videocontroller GET adapterram
       
      i tried to to it like in this example but my knoledge is not good enough
         Local $oWMI = ObjGet("winmgmts:root\CIMV2")
         Local $oDisks = $oWMI.ExecQuery("select * from WIN32_DiskDrive")
       
      So i tired 
         Local $oWMI = ObjGet("winmgmts:root\CIMV2")
         Local $oGMRam= $oWMI.ExecQuery("Win32_videocontroller")
         $Memory=$oGMRam.adapterram
      but this does not work.
      I like to understand what i need to do?
       
    • By water
      Lets say I open 12 Excel workbooks and use _Excel_BookList to get a list of this open workbooks. It can take the function up to 45 seconds to return the result.
      Each call to ObjGet takes longer then the previous one while incrementing the index:
      I searched the forum but only found some threads from 2008 discussing the processing of the ROT (Running Objects Table).
      Does someone have an idea how to enhance this function (some miraculous WinAPI calls ...)?
      #include <Excel.au3> Local $oExcel = _Excel_Open() Global $iTimer = TimerInit() Global $aWorkbooks = _Excel_BookListEX() ConsoleWrite("Runtime for _Excel_BookList: " & TimerDiff($iTimer) & @CRLF) Func _Excel_BookListEX($oExcel = Default) ; Error handler, automatic cleanup at end of function Global $oError = ObjEvent("AutoIt.Error", "__Excel_COMErrFunc_RT") #forceref $oError Local $aBooks[1][3], $iIndex = 0 If IsObj($oExcel) Then If ObjName($oExcel, 1) <> "_Application" Then Return SetError(1, 0, 0) Local $iTemp = $oExcel.Workbooks.Count ReDim $aBooks[$iTemp][3] For $iIndex = 0 To $iTemp - 1 $aBooks[$iIndex][0] = $oExcel.Workbooks($iIndex + 1) $aBooks[$iIndex][1] = $oExcel.Workbooks($iIndex + 1).Name $aBooks[$iIndex][2] = $oExcel.Workbooks($iIndex + 1).Path Next Else If $oExcel <> Default Then Return SetError(1, 0, 0) Local $oWorkbook, $sCLSID_Workbook = "{00020819-0000-0000-C000-000000000046}" While True $iTimerList = TimerInit() $oWorkbook = ObjGet("", $sCLSID_Workbook, $iIndex + 1) If @error Then ExitLoop ConsoleWrite("ObjGet for instance " & $iIndex + 1 & ": " & TimerDiff($iTimerList) & @CRLF) ReDim $aBooks[$iIndex + 1][3] $aBooks[$iIndex][0] = $oWorkbook $aBooks[$iIndex][1] = $oWorkbook.Name $aBooks[$iIndex][2] = $oWorkbook.Path $iIndex += 1 $oWorkbook = 0 WEnd EndIf Return $aBooks EndFunc ;==>_Excel_BookListEX  
    • By WoodGrain
      Hi All,
      I've coded the small script below, but it can't seem to get the instance of Windows Media player as it keeps going to @error, I've not used com objects before so any assistance would be appreciate. I already have WMP open and minimised. I retrieved "WMPlayerApp" from the AutoIT info tool, I've included a copy below.
      I'm using these sources:
      https://msdn.microsoft.com/en-us/library/dd564085.aspx
      https://msdn.microsoft.com/en-us/library/dd564018.aspx
      $oWMP = ObjGet("", "WMPlayerApp") If @error Then MsgBox(0, "Can't get WMP", "Couldn't connect to the WMP instance") Exit EndIf $wmpPlayState = $oWMP.playState MsgBox(0, "Play State", $wmpPlayState) $wmpSongName = $oWMP.currentMedia.name MsgBox(0, "Play State", $wmpSongName) I've also seen references to the below, but I want to get an existing open WMP:
      ObjCreate("wmplayer.OCX") and have looked at the WMP.udf but can't see how it will do either of the functions I've coded above.
       
    • By kingjacob90
      HI
      I am wanting to know what my CPU temp is but don't know what object to use. I don't relay know how objget works so would not know where to start. I have seen people integrate things like windows speech to text into their scripts but don't know how they know what object to use! How do I find the right object? And how dose it work?
       
      Thanks Jacob
×
×
  • Create New...