Hi, I am getting the same error under the same circumstances (C# WinForms app, SDK 9.0) - and it occurs at the same time. If I load the file using AxAcroPDF.LoadFile( strFilename ), and then hit Tab, I get "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." I had the same problem using 8.0.
Have you been able to come up with a solution? Any help would be appreciated! Thanks!
Is anyone else having this problem when tabbing on the reader? It's giving me a lot of grief and I would really appreciate any help.
Also, I just wanted to correct myself from my previous post...I am not using the SDK, I'm just using the activex control that comes with Adobe Reader, and making a reference to it in my .NET WinForms project (VS 2008). After I load a pdf using a call to AxAcroPDF.LoadFile( strFilename ), and then hit tab to the control, I get the following error: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Please help! Thanks!
Hi, it's me again....
I still haven't figured out this problem, but I do have one more tiny piece of information, in hopes that someone knowledgable will see this and be able to help.
The error seems to be thrown when you're tabbing OUT of the pdf viewer. Previously, I was under the impression that the problem was when I tabbed TO the viewer, but I guess I wasn't paying close enough attention. So, if the pdf viewer currently has the focus, and you hit TAB to give focus to the next control - that is when it throws the error:
"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Glad to know it's not only me having the issue. We just deployed a new (.NET CLR 2.0 winform) app and have encountered the issue. Our developers had Adobe Reader 8.x on their workstations and did not encounter (nor can they reproduce) the problem. However, it occured(s) when the application runs on machines with 9.x installed. Subsequent updates of the developer machines to Reader 9.x yield the same error.
We also are having trouble forcing the focus to other controls on the containing form, so by default the PDF ActiveX control has focus and users are naturally using the tab key to navigate away. Curious as to whether there is a way to overrule the default focusing behavior of the ActiveX control or way to intercept the Tab key (LostFocus?).
Also, I tried adding an OnError handler as exposed by the ActiveX control, but the UnhandledException bypasses it.
Lastly, I've not evaulated the SDK - is there anything that could assist?
Here is the underlying error:
"Faulting application <myapp>.exe, version <w.x.y.z>, faulting module acropdf.dll, version 184.108.40.206, fault address 0x0000486c".
Since yesterday's post, I've tried wrapping the Adobe ActiveX control with a custom (VB 6) OCX wrapper to try and intercept the exception. However, there seems to be no event or generic error trapping event that works. And, the same error does occur in a traditional COM DLL vs. the .NET InterOp reference.
I look forward to someone from Adobe weighing in on this one.
I just want to say that I have the same problem.
In addition to the error when using tab I receive it when I close my application, too (When I start the application executable directly).
I hope that Adobe will take care of this, or my company is forced to look for PDF Viewer components from other companys.
I also have found this problem and even build a small vb6 application which demonstrates it. But my application tabs to the Adobe control and then crashes.
See my original thread for the program before I was directed to this thread:
Has anyone been able to get around this by disabling the tab key or something while the AcroPDF control has focus? There HAS to be a way around this...
I am busy with a windows forms app that allows me to select a pdf from a list and have it shown as a preview using AxAcroPDF. I had the same error when "tabbing" through the app. Only thing that helped me was to set TabStop = False in the properties. The error occurs when "tabbing" away from AxAcroPDF. This setting makes sure that your pdf does not get focused when "tabbing" through the system.
In our applications, the users are often zooming in/out, using bookmarks and paging through the PDF using the toolbar embedded in the ActiveX control. So they need to put focus on the control to do this.
BTW: I have checked Adobe Reader X (they appear to have updated the ActiveX control), but the Tab problem still occurs. Adobe needs to fix this.
I had the same problem in my application but I found the following workaround:
Application.ThreadException += delegate(object sender, ThreadExceptionEventArgs e)
if (e.Exception.GetType() == typeof(AccessViolationException))
// Ignore this type of exception to fix the bug in the Adobe
// Reader ActiveX (i.e. TAB out of the control).
// Add the original callstack of the exception data because
// it will be overrided when the exception is re-thrown.
This will make the exception disappear but it will also lock the TAB cycle inside the control. The user won't be able to "TAB out" of the control.
For my application, I didn't really mind if the user was 'locked in' but I assume that something could be done in the delegate to set the focus to the next control in the form, if needed.