Solved

Crashing program using Acrobat OCX

Posted on 2002-03-27
10
410 Views
Last Modified: 2013-12-02
Hi,

I have become quite reliant on using the Adobe Acrobat OCX component in a lot of the software I write for internal use in the company I work for.

Basically the reason behind this is that I am quite fluent in postscript but the majority of the printers on site are not postscript compatible. So the route I take is:-

[1] Create postscript file
[2] Call ghostscript (free distiller!) to distill the file to a PDF
[3] Use the Adobe Acrobat OCX to display the file and then print to any of the printers on our network.

But I seem to have a problem. Obviously, while developing, I'm running the software multiple times in quick sucession to debug the reports (it saves a lot of paper!!). But after running the software a couple of dozen times I start to get errors that make it look like a memory leak or something similar : Icons start to look corrupt, strange error messages, other software stops working, low system resource warnings.

I have tried both version 4 and 5 of Acrobat and also tried it on a 'fresh' install of Delphi on a different machine. But the same problem exhibits itself.

The first piece of software I wrote was quite complex and I thought that maybe it was that that was causing a problem. But since then I have done a few things which point to the OCX. Firstly, I stripped out everything expect the PDF display part and the error was still apparent. I then tried removing the PDF display part from another piece of software, viewing them in the external standalone Acrobat Reader instead, and the problem disappeared.

But I've noticed a few other people are using the OCX and nobody is complaining about this problem. So I'm wondering what I'm doing wrong or if there is anything I can do that will cure the problem??

My main problem is that the latest piece of software will be used over and over again when in full use and I don't want it crashing the users computer all the time. I've 'got away with it' until now because the other software has only had to be run once or twice daily.

BTW I'm using Delphi V6 but had the same problem in V5.

Hope someone can help,

Trevor.
0
Comment
Question by:trevorb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 1

Expert Comment

by:SchweizerD
ID: 6899281
Trevor,

I would look very closely as to how you are using the form with the OCX. Is the form properly freed after use, is it recreated every time ? How do you load the PDF file ?

Maybe something there is causing these symptoms. Does this happen if you have a minimal application (only one form with the OCX on it) ?

HTH
David
0
 

Author Comment

by:trevorb
ID: 6899312
Hi David,

Thanks for your comments.

Initially, it was on a complex form but I stripped it right down to the very basics to try to sort the problem and it still appears to do it.

I actually put the Adobe PDF 'component' onto the form (held in a panel) at design time which I assumed meant that Delphi would automatically free up everything including the PDF component when the program exited. Perhaps this is wrong of me to assume? Should I free this component manually in the the close event do you think?

I'm loading the file by setting the 'src' property at runtime within the software. This is only done once I have the correct PDF available that I want to display i.e. after ghostscript has finished.

Trevor.
0
 
LVL 1

Expert Comment

by:SchweizerD
ID: 6899339
Trevor,

I'd expect the component to be freed automatically when the form is freed (since this is the normal behaviour of the VCL). It would not hurt to do so manually, though.

Maybe it is something different. When you use the OCX, a background copy of the Acrobat Reader program is started (I seem to remember so). You can check this is the Task Manager. Maybe that is going wrong, e.g. the Reader is not shut down properly ?

Have you tried different Windows versions ?

HTH
David
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 

Author Comment

by:trevorb
ID: 6902204
Hi David,

I've put the FREE command into the close event for the form but it still exhibits this strange behaviour.

You're right, Acrobat does load each time, in the background. I've checked the Task Manager and it 'appears' to close with the software i.e. shuts down ok.

I've got the system monitor running. And the free memory just keeps dropping each time the software is executed. One strange thing that does happen though is that if, before the memory is completely 'used' and the problems start, I shut Delphi down and restart it, the memory used seems to be released. Very strange.

Lots of Easter head scratching I think!

Trevor.
0
 
LVL 1

Expert Comment

by:SchweizerD
ID: 6902224
Hi Trevor,

That seems to point at the Delphi OLE-related library units. If you have the Delphi library source and a tool like Sleuth QA (www.turbopower.com), you might be able to track down the problem that way, I'd guess. After Easter, I suppose.

Good luck,

David
0
 

Author Comment

by:trevorb
ID: 6902237
Thanks again David,

I'll have a look at the TurboPower website. I remember using MemorySlueth (by the same Company) that came free with one of the Delphi versions. Thinking about it, that is probably what I need to try to track this down.

But after Easter I think ;-) !

I'll let you know how I get on with that..

Trevor.
0
 
LVL 1

Accepted Solution

by:
SchweizerD earned 200 total points
ID: 6902243
Hi Trevor,

That seems to point at the Delphi OLE-related library units. If you have the Delphi library source and a tool like Sleuth QA (www.turbopower.com), you might be able to track down the problem that way, I'd guess. After Easter, I suppose.

Good luck,

David
0
 
LVL 1

Expert Comment

by:xsoft
ID: 6961517
listening
0
 

Expert Comment

by:CleanupPing
ID: 9343206
trevorb:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 

Author Comment

by:trevorb
ID: 9343442
As I have indicated on another question I left open, I can only apologise I didn't close the question, I was hoping for further comment because I still have problems with both of these. But I will close this topic off if you feel I must. I will award the points to SchweizerD as at least he went someway to helping me. I was just hoping that some day someone might answer my question.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I. Introduction In a previous article (http://www.experts-exchange.com/Web_Development/Document_Imaging/A_6537-PaperPort-Upgrade-How-to-download-and-install-updated-versions-of-PaperPort-11-and-12.html) (now deprecated), I discussed how to upgrad…
I. Introduction In a previous article (http://www.experts-exchange.com/Web_Development/Document_Imaging/A_6537-PaperPort-Upgrade-How-to-download-and-install-updated-versions-of-PaperPort-11-and-12.html) (now deprecated), I discussed how to upgrad…
This video is the second in a two-part series that discusses PaperPort's "Send To Bar" feature . The first video tutorial (http://www.experts-exchange.com/VP_207.html) explains the purpose of the Send To Bar, how to use it, and how to hide unwanted …
We often encounter PDF files that are pure images, that is, they do not have text characters, but instead contain only raster graphics. The most common causes of this are document scanning software and faxing software/services that create image-only…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question