2015-02-23 24 views
1

情景:的WinForms桌面應用程序,NET 2.0福昕PDF SDK - AccessViolationException在PrintWithDialog

我們有我們的用戶羣的0.01%誰是無法打印,我們通過福昕PDF SDK的ActiveX呈現文檔的問題v5.0.1

當用戶單擊「打印」按鈕時,我們在查看器控件實例上調用PrintWithDialog()方法。此時,將引發訪問衝突異常,然後應用程序掛起。打印對話框不顯示。沒有進一步的用戶輸入(鼠標,鍵盤)使其恢復生命,並且該進程必須通過任務管理器來終止。

的異常堆棧跟蹤是:

AccessViolationException - Attempted to read or write protected memory. This is 
often an indication that other memory is corrupt. 

    at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData) 
    at FoxitPDFSDKStdLib._DFoxitPDFSDK.PrintWithDialog() 
    at AxFoxitPDFSDKStdLib.AxFoxitPDFSDK.PrintWithDialog() 
    at MyCode.PDFToolBarButtonClick(Object sender, EventArgs e) 

我們無法重現的問題,福昕似乎不能夠做任何事情來幫助我們,因爲我們不能給他們再現了一個項目問題。

我懷疑是指向Windows 7和打印設置的組策略控制。我們已經取得了一些成功,要求受影響的用戶刪除並重新安裝默認打印機,但是問題在一兩天後會重新出現。一個站點的策略設置控制誰可以用彩色打印,並以不同的方式安裝打印機(同一物理設備)。

有沒有人有任何Windows 7的經驗或組策略設置,影響打印?

編輯:這只是FoxIt受此問題影響。其他一切 - Acrobat,Word,記事本等打印沒有問題。

+0

您是否在此嘗試過此修補程序? 「當您運行基於.NET Framework 2.0的應用程序時,會發生System.AccessViolationException異常......」http://support.microsoft.com/kb/975954 – 2015-02-26 09:34:21

+0

@Paul Zahra。謝謝。我們會放棄它。 – 2015-02-26 14:56:58

+0

如果您進行崩潰轉儲,您可能會獲得更多信息,但如果問題出在FoxIt的dll上,則需要由他們來閱讀轉儲並修復它。也就是說,如果您發現某個驅動程序或其他東西有些奇怪,您可以將其追蹤到特定的dll。 http://blogs.msdn.com/b/tess/archive/2008/02/04/net-debugging-demos-lab-1-hang.aspx – JMarsch 2015-02-27 20:17:13

回答

3

我可以模擬這種情況,如果我刪除默認的打印機設置(意味着沒有打印機設置爲默認值),所以臨時重命名從「設備」到「OldDevice」

HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows\Device 

我簡單以下注冊表鍵形式:

public Form1() 
{ 
    InitializeComponent(); 
    try 
    { 
     this.axFoxitPDFSDK1.OpenFile(@"C:\foxit\FoxitPDFActiveX51_Manual.pdf", ""); 

     this.axFoxitPDFSDK1.PrintWithDialog(); 
    } 
    catch (System.Exception exc) 
    { 
     Debug.WriteLine(exc.StackTrace); 
     Debug.WriteLine(exc.Message); 
     if (exc.InnerException != null) 
     { 
      Debug.WriteLine(exc.InnerException.Message); 
     } 

    } 
} 

和調試輸出相關:

Eccezione first-chance di tipo 'System.AccessViolationException' in mscorlib.dll 
'MySOfoxit.vshost.exe' (Gestito (v2.0.50727)): 'C:\Windows\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll' caricato, caricamento simboli ignorato. Il modulo è ottimizzato e l'opzione 'Just My Code' del debugger è abilitata. 
    in System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData) 
    in FoxitPDFSDKStdLib._DFoxitPDFSDK.PrintWithDialog() 
    in AxFoxitPDFSDKStdLib.AxFoxitPDFSDK.PrintWithDialog() 
    in MySOfoxit.Form1..ctor() in c:\foxit\MySOfoxit\Form1.cs:riga 23 
Tentativo di lettura o scrittura della memoria protetta. Spesso questa condizione indica che altre parti della memoria sono danneggiate. 

我CA n提及這個link(或許)是觸發事件的可能原因之一。其他應用程序(WinWord,Adobe Reader)按預期工作(僅需要手動選擇打印機)

+0

這看起來很有希望。在賞金到期之前,我會盡我所能去測試這個。謝謝。 – 2015-03-03 21:43:56

+0

我現在可以按照您的描述重現問題。我馬上就會接觸到我們的客戶。 – 2015-03-03 22:04:01

+0

已經通過了重現FoxIt的步驟,他們現在已經生成了該組件的修訂版本,而且這似乎在我們受影響的站點上運行良好。 – 2015-05-11 08:54:42