I would like to know if any of you have come across this issue.
I'm running an application built by me in a computer with LabVIEW Run-time 9 in which I display a PDF file using an ActiveX control:
The target computer runs Adboe Reader 9.0. Everything works perfect until the application is closed. From time to time (nearly most of the times), I've got the next windows error:
"Application Error: The instruction at "0x0ffd609c" referenced memory at "0x00000014". The memory could not be "read". Click on OK to terminate the program".
Trying to find out the reason, I found a couple of forums which claim that the reason is a bug in Adobe 9.0 (actually, I've tried running the application with Adobe Reader 8 and I cannot repeat the error). Any of you have had this error before and found a solution? Those links weren't about LabVIEW and I have no idea how to get around this issue.
Any help is appreciate it.
Thanks in advance.
Solved! Go to Solution.
Thank you very much for replying. Unfortunately, I removed all the calls to DLLs and just created a single executable for the PDF display and keep having the same error when closing it... A version bug keeps being, in my opinion, the guilty for this windows error... Let's see if a workaround is found as I don't want to restrict the end user with a specific Adobe version. Finger crossed.
Thank you very much for finding a possible reason.
In the develop computer, I'm running Windows XP Professional, version 2002, SP3. Exactly the same version is running in the customer computer.
To who may be interested, I managed to find a workaround for this bug in Adobe Reader 9.0.
It seems that, somehow, LabVIEW, and other programming tools, straggle with this version of Adobe (I assume that this is due to this bug) when closing the reference to Adobe created by the ActiveX container. So the solution would be closing "by hand" this reference, and telling Windows to free all the relation between the application (LabVIEW for us) and Adobe. The idea is that when we've done with the VI which displays the PDF via ActiveX, we should close the reference to the ActiveX control, close the reference to the VI, and:
- process all the Windows messages currently in the message queue (.NET: System.Windows.Form.Application -> DoEvents
- run CoFreeUnusedLibraries in "ole32.dll"
I hope this information can help somebody, as I wasted too much time to figure this out (finding eventually the answer in a forum of Adobe!)
P.S. For those who program in C# as well, check this link; this was my source.