Jump to content

_AcrobatShow() error ntdll.dll 0xc000000d


Simpel
 Share

Recommended Posts

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 = Win_10   Build = 19044   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.

Link to comment
Share on other sites

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 = Win_10   Build = 19044   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.

Link to comment
Share on other sites

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

 

 

Saludos

Link to comment
Share on other sites

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 = Win_10   Build = 19044   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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 = Win_10   Build = 19044   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.

Link to comment
Share on other sites

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 = Win_10   Build = 19044   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.

Link to comment
Share on other sites

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?

Link to comment
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
 Share

×
×
  • Create New...