AccessViolationException fatal error, Acrobat 9, AxAcroPDFLib, .NET, Win7
How do I work around the following fatal error: AccessViolationException
Steps to reproduce the error:
1. In MS VisualStudio 2008, Create a Windows Form Application, add a Panel and a Button components to the form.
2. Add a Reference to the Acrobat COM component for AxAcroPDFLib
3. Add the following code to the main form:
private AxAcroPDFLib.AxAcroPDF ax = new AxAcroPDFLib.AxAcroPDF();
private void button1_Click(object sender, EventArgs e)
{
panel1.Controls.Add(ax);
ax.LoadFile(@"c:\temp\myfile.pdf");
ax.setView("Fit");
}
4. Run the application
5. Click the Button
6. Press the TAB key on the keyboard.
Result: The application crashes with an AccessViolationException: Memory Corrupted error.
Note: I had been working on an application for about a month now, but had Never pressed the Tab key while the application was running until today!!
Although I did not yet test EVERY key, all other keys and activities inside and outside of the Acrobat component, application, and OS seem to work ok. I can't deploy an application to production if it will crash on Tab keypress.
Platform:
Windows 7, 32bit, all current updates
Acrobat 9 Standard, all current updates
Microsoft Visual Studio 2008 Professional, all current updates
I'm not an Acrobat SDK developer expert, so this may be some simple configuration setting.
Any assistance is greatly appreciated.
Arnold
