Jump to content
Simpel

_AcrobatShow() error ntdll.dll 0xc000000d

Recommended Posts

Simpel

Hi,

since some days I become this error message exiting my app:

Windows-Error-nach-Exit.PNG

Eventviewer shows following data:

Name der fehlerhaften Anwendung: autoit3.exe, Version: 3.3.14.2, Zeitstempel: 0x55fc1979
Name des fehlerhaften Moduls: ntdll.dll, Version: 6.1.7601.23864, Zeitstempel: 0x595fa490
Ausnahmecode: 0xc000000d
Fehleroffset: 0x000987e0

I stripped my code from 1500 lines down to 70:

#include <GUIConstants.au3>
Global $g_sPathToPDF = ; path to some pdf file to show

Opt("GUIOnEventMode", 1) ; default ist 0 ; 1 bedeutet, daß bei Klick direkt die darunterbeschriebene Funktion ausgeführt wird
Global $g_hGUI_MAIN ; Haupt-GUI
Global $g_hDummy_Main ; Dummy um Fokus in der Haupt-GUI unsichtbar zu setzen
Global $g_hGUI_Pruefen ; GUI zum Prüfen aller PDF
Global $g_hGUI_PDF ; GUI PDF-Ansicht der ausgewählten PDF
Global $g_hPDF ; ActiveX control welches das PDF enthält
Global $g_oAcrobatReader ; AcrobatReaderObjekt in dem die PDF gezeigt werden

_GUI_Main()
GUISetOnEvent ($GUI_EVENT_CLOSE, "_Exit_Main" , $g_hGUI_MAIN)
While 1
    Sleep(1)
WEnd
Exit

Func _GUI_Main() ; GUI-MAIN
    $g_hGUI_MAIN = GUICreate("MAIN", 390, 390, 763, 372)
    GUISetFont(12)
    GUICtrlCreateButton("NEXT", 20, 20, 350, 55, $BS_DEFPUSHBUTTON) ; Default-Knopf
    GUICtrlSetOnEvent(-1, "_GUI_Pruefen")
    GUISetState(@SW_SHOW, $g_hGUI_MAIN) ; GUI anzeigen
EndFunc

Func _GUI_Pruefen() ; GUI zum Prüfen der PDF
    GUISetState(@SW_HIDE, $g_hGUI_MAIN) ; MAIN-GUI ausblenden
    Opt("GUIOnEventMode", 0) ; wieder auf Default gesetzt
    $g_hGUI_Pruefen = GUICreate("RIGHT", 490,950, 1057, 91, -1, $WS_EX_APPWINDOW, $g_hGUI_MAIN)
    _AcrobatShow($g_sPathToPDF, "", 367, 91, 674, 950, $g_hGUI_Pruefen) ; PDF-GUI erstellen
    GUISetState(@SW_SHOW, $g_hGUI_Pruefen) ; GUI-Prüfen anzeigen
    Local $msg
    While 1
        $msg = GuiGetMsg() ; Aktion mit der GUI registrieren
        Switch $msg ; je nach Aktion mit der GUI
            Case $GUI_EVENT_CLOSE ; X gedrückt
                $g_oAcrobatReader = "" ; zerstöre das Objekt AcrobatReader
                GUIDelete($g_hGUI_PDF) ; lösche die GUI-PDF
                GUIDelete($g_hGUI_Pruefen) ; lösche die GUI-Prüfen
                Opt("GUIOnEventMode", 1) ; Default 0
                GUISetState(@SW_SHOW, $g_hGUI_MAIN) ; MAIN-GUI wieder zeigen
                Return
        EndSwitch
    WEnd
EndFunc

Func _Exit_Main() ; ausführen, wenn die MAIN-GUI schließt
    ConsoleWrite("EXIT" & @CRLF)
    Exit
EndFunc

Func _AcrobatShow($sFile, $sTitle = "PDF ", $iLeft = 50, $iTop = 0, $iWidth = 1000, $iHeight = 700, $hWnd = "") ; GUI-PDF erstellen
    If FileExists($sFile) Then ; wenn das PDF existiert
        $g_oAcrobatReader = ObjCreate("AcroPDF.PDF.1")
        $g_oAcrobatReader.src = $sFile ; Quelle ist das File
        $g_oAcrobatReader.SetLayoutMode("SinglePage") ; default "SinglePage"
        $g_oAcrobatReader.SetPageMode("none") ; default "none"
        $g_oAcrobatReader.SetShowToolbar(0) ; Tool-Bar nicht zeigen 0
        $g_oAcrobatReader.SetShowScrollbars(0) ; Scroll-Balken nicht zeigen 0
        $g_oAcrobatReader.SetView("fit") ; "fit" falls wer eigene Einstellungen im Reader gespeichert hat
        $g_hGUI_PDF = GUICreate($sTitle, $iWidth, $iHeight, $iLeft, $iTop, -1, -1, $hWnd) ; GUI als Child zu GUI-PRUEFEN erstellen - es soll nicht aktiviert werden
        $g_hPDF = GUICtrlCreateObj($g_oAcrobatReader, 0, 0, $iWidth, $iHeight) ; Objekt für das PDF erstellen
        GUICtrlSetStyle($g_hPDF, $WS_VISIBLE) ; PDF anzeigen
        GUISetState(@SW_SHOW, $g_hGUI_PDF) ; GUI-PDF anzeigen
    Else
        MsgBox(0, 'ERROR', "No PDF found.")
    EndIf
EndFunc

Do following steps to prove:

- start app

- click "next" on main gui

- wait minimum 5 seconds (until the arrows left and right on "gui left" disappear)

- close gui left or right

- close main gui

- look on console written "EXIT" the last code line before exit

- now windows error message above appears

The funny thing is if I don't wait the 5 seconds (before the half transparent arrows disappear) closing the gui then I will get no win error message.

If I comment _AcrobatShow() out then the error never appears. So it seemed to be an acrobat reader issue. Every week at work there are a lot of updates, but there is no chance to know which one. But since one update this error happens.

Any solutions? Regards, Conrad


SciTE4AutoIt = 3.7.3.0   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win7Pro SP1   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE     H:\...\AutoIt3      H:\...\AutoIt3\Include     (H:\ = Network Drive)

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

Share this post


Link to post
Share on other sites
Simpel

Hi,

now I stripped the code down to 30 lines:

#include <GUIConstants.au3>
Global $g_sPathToPDF = ; fill in path to pdf
Global $g_hGUI, $g_oAcrobatReader, $g_hPDF

_AcrobatShow($g_sPathToPDF)
Local $msg
While 1
    $msg = GuiGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            $g_hPDF = ""
            $g_oAcrobatReader = ""
            GUIDelete($g_hGUI)
            ConsoleWrite("EXIT" & @CRLF)
            Exit
    EndSwitch
WEnd

Func _AcrobatShow($sFile, $sTitle = "PDF ", $iLeft = - 1, $iTop = - 1, $iWidth = 1000, $iHeight = 700)
    If FileExists($sFile) Then
        $g_oAcrobatReader = ObjCreate("AcroPDF.PDF.1")
        $g_oAcrobatReader.src = $sFile
        $g_hGUI = GUICreate($sTitle, $iWidth, $iHeight, $iLeft, $iTop, BitOR($GUI_SS_DEFAULT_GUI, $WS_CLIPCHILDREN))
        $g_hPDF = GUICtrlCreateObj($g_oAcrobatReader, 0, 0, $iWidth, $iHeight)
        GUISetState(@SW_SHOW, $g_hGUI)
    Else
        MsgBox(0, 'ERROR', "No PDF found.")
    EndIf
EndFunc

If I comment out:

  $g_hPDF = GUICtrlCreateObj($g_oAcrobatReader, 0, 0, $iWidth, $iHeight)
  GUICtrlSetStyle($g_hPDF, $WS_VISIBLE)

then the error doesn't occur. So it seemed to be something with that GUICtrlObject. Do I have to destroy $g_hPDF in another way then to set ""?

Conrad


SciTE4AutoIt = 3.7.3.0   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win7Pro SP1   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE     H:\...\AutoIt3      H:\...\AutoIt3\Include     (H:\ = Network Drive)

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

Share this post


Link to post
Share on other sites
Danyfirex

Hello. It's working right for me. Using Adobe Reader XI Version 11.0.11.18.

 

 

Saludos

Share this post


Link to post
Share on other sites
Simpel

Thank you.

I use Adobe Acrobat Reader DC Version 2017.009.20044.


SciTE4AutoIt = 3.7.3.0   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win7Pro SP1   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE     H:\...\AutoIt3      H:\...\AutoIt3\Include     (H:\ = Network Drive)

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

Share this post


Link to post
Share on other sites
Danyfirex

Try to free the control and the object. Maybe that helps.

            GUICtrlDelete($g_hPDF)
            $g_oAcrobatReader = Null
            GUIDelete($g_hGUI)
            ConsoleWrite("EXIT" & @CRLF)

 

or maybe just free the object.

Saludos

Share this post


Link to post
Share on other sites
Simpel

Nope.

GUICtrlDelete($g_hPDF) returns 1 but error occurs anyway.

55 minutes ago, Danyfirex said:

or maybe just free the object.

How to do that? I thought with $g_oAcrobatReader = Null it's done. Other possibility?

Conrad


SciTE4AutoIt = 3.7.3.0   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win7Pro SP1   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE     H:\...\AutoIt3      H:\...\AutoIt3\Include     (H:\ = Network Drive)

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

Share this post


Link to post
Share on other sites
Simpel

So, just to keep my colleagues smooth I suppress this error messages as long I don't have a real solution:

Func _SuppressErrorMessage()
    RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\Windows Error Reporting","DontShowUI", "REG_DWORD", 1)
    Local $sFileName = "XYZ"
    Local Const $sData = 'PING -n 10 127.0.0.1 > nul' & @CRLF _ 
                        & 'reg add "HKCU\Software\Microsoft\Windows\Windows Error Reporting" /v DontShowUI /t REG_DWORD /d 0 /f'
    Local Const $hFileOpen = FileOpen(@TempDir & '\' & $sFileName & '.bat', 2)
    If $hFileOpen = -1 Then
        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\Windows Error Reporting","DontShowUI", "REG_DWORD", 0)
        Return SetError(1, 0, 0)
    EndIf
    FileWrite($hFileOpen, $sData)
    FileClose($hFileOpen)
    Return Run(@TempDir & '\' & $sFileName & '.bat', @TempDir, @SW_HIDE)
EndFunc

_SuppressErrorMesssage() is inserted right before exit. So nearly for 10 seconds no messages like this will be shown.

Conrad


SciTE4AutoIt = 3.7.3.0   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win7Pro SP1   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE     H:\...\AutoIt3      H:\...\AutoIt3\Include     (H:\ = Network Drive)

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

Share this post


Link to post
Share on other sites
Skysnake

Works here

>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\AutoIt\Forum_SomePDFError\New AutoIt v3 Script.au3" /UserParams    
+>07:26:28 Starting AutoIt3Wrapper v.17.224.935.0 SciTE v.3.7.3.0   Keyboard:00000409  OS:WIN_10/  CPU:X64 OS:X64  Environment(Language:0409)  CodePage:0  utf8.auto.check:4
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\user\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\user\AppData\Local\AutoIt v3\SciTE 
>Running AU3Check (3.3.14.2)  from:C:\Program Files (x86)\AutoIt3  input:C:\AutoIt\Forum_SomePDFError\New AutoIt v3 Script.au3
+>07:26:28 AU3Check ended.rc:0
>Running:(3.3.14.2):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\AutoIt\Forum_SomePDFError\New AutoIt v3 Script.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop

Perhaps REMOVE and re-install Reader?

Also, check for Reader Security settings?

https://forums.adobe.com/thread/1955530

https://helpx.adobe.com/acrobat/kb/troubleshoot-problems-opening-pdfs.html

Skysnake


Skysnake

Why is the snake in the sky?

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

    • genius257
      By genius257
      I've made a library, based on AutoItObject UDF with the goal of implementing getter and setter functionality and make it possible to define new object properties in as few steps as possible.
      Thank you to @trancexx for getting me on the right track, and all users in Hooking into the IDispatch interface for the code to get me going.
      If I've forgotten to add credit, please let me know
      Example:
      #include "AutoItObject_Internal.au3" $myCar = IDispatch() $myCar.make = 'Ford' $myCar.model = 'Mustang' $myCar.year = 1969 $myCar.__defineGetter('DisplayCar', DisplayCar) Func DisplayCar($oThis) Return 'A Beautiful ' & $oThis.parent.year & ' ' & $oThis.parent.make & ' ' & $oThis.parent.model EndFunc MsgBox(0, "", $myCar.DisplayCar) More examples: https://github.com/genius257/AutoItObject-Internal/tree/master/Examples
      Version: 2.0.0
      AutoItObject_Internal.au3
      Documentation
      Edit2 (19th March 2017):
      First of all, sorry about the lack of updates on this project. I always start too many projects and end up ignoring old projects, if I run into problems ^^'.
      So I've started moving my AutoIt scripts to GitHub. I will still post the most recent script version here.
    • xiantez
      By xiantez
      This script used to work on an older version of AutoIT. Currently I am running AutoIT v3.3.14.5 and it's failing.
      Func PublicIP() ;Post public facing IP address Local $url = 'https://www.google.com/search?client=opera&q=what+is+my+ip&sourceid=opera&ie=UTF-8&oe=UTF-8' Local $getIPaddress = BinaryToString(InetRead($url)) Local $sStart = 'clamp:2">' Local $sEnd = '</div>' Local $ipaddress = _StringBetween($getIPaddress, $sStart, $sEnd For $i In $ipaddress MsgBox(0, 'External IP', "Your public IP address is " & $i) Next EndFunc ;==>PublicIP The console output shows:
      "C:\Users\user\Documents\AutoIT\Scripts\WSI Tools.au3" (197) : ==> Variable must be of type "Object".: For $i In $ipaddress For $i In $ipaddress^ ERROR ->14:12:16 AutoIt3.exe ended.rc:1 +>14:12:16 AutoIt3Wrapper Finished. >Exit code: 1 Time: 9.811
    • tuffgong
      By tuffgong
      Good morning. I have a system I am trying to automate that works like this: user fills a column in an Excel spreadsheet with values they would like printed and saves it to a folder on their desktop, they start the script and it formats their data into a text file (adding a prefix) and sends the text file as a .bch file where it needs to go. This is working:
      #include <Array.au3> #include <Excel.au3> #include <File.au3> #include <MsgBoxConstants.au3> Global $sSTCArray Global $sFilename = @DesktopDir & "\Labels\print.txt" Global $sWorkbook = @DesktopDir & "\Labels\Labels.xlsx" Global $oExcel = _Excel_Open(False,False,False,False,True) barcodePrint() Func barcodePrint() $Read = _Excel_BookOpen($oExcel, $sWorkbook, True, False, Default, Default, Default) FileOpen($sFilename, $FO_OVERWRITE) ;Global $oWorkbook = _Excel_BookAttach($oExcel) Global $sSTCArray = _Excel_RangeRead($Read) For $i = 0 to UBound($sSTCArray, 1) - 1 FileWriteLine($sFilename, "!StaticShelving1x3_ZPL," & $sSTCArray[$i]) Next _Excel_Close($oExcel) FileMove($sFilename, "***file path***\print.bch") EndFunc However, it only works if the user first formats the spreadsheet to text. I want to automate that. From what I have read it appears AutoIt does not like formatting cells that already have values. True? Can I pull the values from an un-formatted (default GENERAL format) spreadsheet and go straight to my text file? I have also considered opening a second spreadsheet, formatting it, and copying the values over. Like this:
        
      Global $sPrefix Global $oPath Global $sSTCArray Global $sFilename = @DesktopDir & "\Labels\print.txt" Global $sWorkbook = @DesktopDir & "\Labels\Labels.xlsx" Global $oExcel = _Excel_Open(False,False,False,False,True) Global $aArray Global $bExcel _Excel_BookNew($bExcel) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $aArray = IniReadSection("***File path***\barcode.ini", "stc/rvt/mgm") $sPrefix = $aArray[1][1] $oPath = $aArray[2][1] barcodePrint() EndSwitch WEnd Func barcodePrint() $oWorkbook = _Excel_BookOpen($bExcel, @DesktopDir & "\Labels\print.xlsx") $oWorkbook.ActiveSheet.Columns("A").NumberFormat = "@" Local $Read = _Excel_BookOpen($oExcel, $sWorkbook, True, False, Default, Default, Default) $oCopy = _Excel_RangeRead($sWorkbook) _Excel_RangeWrite($oWorkbook, Default, $oCopy) FileOpen($sFilename, $FO_OVERWRITE) $sSTCArray = _Excel_RangeRead($Read,"Default","Default",3) ;_ArrayDisplay($sSTCArray) For $i = 0 to UBound($sSTCArray, 1) - 1 FileWriteLine($sFilename, $sPrefix & $sSTCArray[$i]) Next _Excel_Close($oExcel) ;FileMove($sFilename, $oPath) Exit EndFunc This does not like the formatting of $oWorkbook: "Variable must be of type 'Object'".  Do I need this second sheet? If so, how can I format it? Is there a better way to get the Excel values into a .txt file? Any ideas would be appreciated. Thanks!
    • marcoauto
      By marcoauto
      Ciao
      I would like to control an ATEM Video Mixer from autoit. I downloaded his SDK which is written in c ++ and I found the sequences to interface, but I was not able to convert the script to self.
      The instructions say to follow this sequence:
      and to connectTo with C++ is:
      string address = "192.168.1.240"; _BMDSwitcherConnectToFailure failureReason = 0; IBMDSwitcher switcher = null; var discovery = new CBMDSwitcherDiscovery(); discovery.ConnectTo(address, out switcher, out failureReason); From Blackmagic SDK:
      IBMDSwitcherDiscovery::ConnectTo method
      The ConnectTo method connects to the specified switcher and returns an IBMDSwitcher object interface for the switcher.
      Syntax HRESULT ConnectTo (string deviceAddress, IBMDSwitcher** switcherDevice, BMDSwitcherConnectToFailure* failReason); Parameters: deviceAddress in Network hostname or IP address of switcher to connect to. switcherDevice out IBMDSwitcher object interface for the connected switcher. failReason out Reason for connection failure as a BMDSwitcherConnectToFailure value. So, I have I tried these solutions but with non success:
      $DllName =@ScriptDir&"\BMDSwitcherAPI.dll" $result = DllCall($DllName, "none", "IBMDSwitcherDiscovery::ConnectTo" & @CRLF) ConsoleWrite("DLLCall Result: " & $result & @CRLF) and I have tried also create an Object (That I think is the best way solution):
      #include <MsgBoxConstants.au3> $oSwitcher=ObjCreate("IBMDSwitcher") If IsObj($oSwitcher) Then MsgBox(64, "", "Object $oSwitcher created successfully") EndIf $oAtem=ObjCreate("IBMDSwitcherDiscovery") If IsObj($oAtem) Then MsgBox(64, "", "Object $oAtem created successfully") EndIf $failureReason =ObjCreate("_BMDSwitcherConnectToFailure") If IsObj($failureReason) Then MsgBox(64, "", "Object $failureReason created successfully") EndIf $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") ; Install a custom error handler Global $errore,$oSwitcher1 $oAtem.ConnectTo("192.168.1.36",$oSwitcher,$failureReason); ; This is the custom error handler Func MyErrFunc() $HexNumber = Hex($oMyError.number, 8) MsgBox(0, "", "We intercepted a COM Error !" & @CRLF & _ "Number is: " & $HexNumber & @CRLF & _ "Windescription is: " & $oMyError.windescription & @CRLF & _ "Source is: " & $oMyError.source & @CRLF & _ "Description is: " & $oMyError.description & @CRLF & _ "Helpfile is: " & $oMyError.helpfile & @CRLF & _ "Helpcontext is: " & $oMyError.helpcontext & @CRLF & _ "Lastdllerror is: " & $oMyError.lastdllerror & @CRLF & _ "Scriptline is: " & $oMyError.scriptline) EndFunc ;==>MyErrFunc But the result is:
      We intercepted a COM Error !
      Number is: 000000A9
      Windescription is: Variable must be of type 'Object'.
      Source is: 
      Description is: 
      Helpfile is: 
      Helpcontext is: 
      Lastdllerror is: 0
      Scriptline is: 17
      The BMDSwitcherAPI.dll is registered in system. Can someone help me?
      Grazie
      Marco
    • FrancescoDiMuro
      By FrancescoDiMuro
      Good evening everyone
      I'm working on a little project of mines, and I was trying to use WMI Object.
      The question which I don't find an answer is: 
      Once I do the query with WMI Object, something like "SELECT * FROM Win32_LogonSession", instead of specify the field of the collection returned, ( i.e. $colItems.Caption ), can I loop though each property and each value of the property, writing so one row of code only?
      Hope my question was clear enough.
      Thanks in advance.

      Best Regards.
×