在某些带有 AccessViolationException 的机器上使用 AxAcroPDF 打开表单时崩溃,而在其他机器上则可以正常工作。操作系统 Windows 7,框架 4.0。应用程序 - Winforms。值得 AcrobatReader XI
很明显,当使用 AxAcroPDF 打开表单时,某些内容没有足够的权限,但我什至不知道从什么开始
Stacktrace:(可以看出是落在了组件的初始化上)
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack: at
System.Windows.Forms.UnsafeNativeMethods+IO|eObject.DoVerb(Int32, IntPtr, IOleClientSite, Int32, IntPtr, COMRECT) at
System.Windows.Forms.AxHost.DoVerb(Int32) at
System.Windows.Forms.AxHost.InPlaceActivateO at
System.Windows.Forms.AxHost.TransitionUpTo(Int32) at
System.Windows.Forms.AxHost.CreateHand|eO at
System.Windows.Form5.Control.CreateControI(Boolean) at
System.Window5.Forms.Control.CreateControl(Boo|ean) at
System.Windows.Forms.Contro|.CreateControl(Boo|ean) at
System.Windows.Forms.AxHost.EndInitO at
CreatePackage.CreateJnitializeCornponentO at
CreatePackage.Create..ctor0 at
CreatePackaqe.Form1.createDocumentButton Click(Svstem.Obiect. Svstem.EventAras}
禁用 DEP 保护有所帮助。