Solved

Crashing program using Acrobat OCX

Posted on 2002-03-27
10
406 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
10 Comments
 
LVL 1

Expert Comment

by:SchweizerD
Comment Utility
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
Comment Utility
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
Comment Utility
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
 

Author Comment

by:trevorb
Comment Utility
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
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:trevorb
Comment Utility
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
Comment Utility
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
Comment Utility
listening
0
 

Expert Comment

by:CleanupPing
Comment Utility
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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
splitting pages in PDF 3 93
Delphi XE10 Round Image 2 48
Magic Software info 18 101
control image tags in a string ? 12 59
Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
Sometimes we receive PDF files that are in the wrong orientation. They may be sideways or even upside down. This most commonly happens with scanned or faxed documents. It is possible to rotate the view of these PDFs with the free Adobe Reader produc…
This video Micro Tutorial is the second in a two-part series that shows how to create and use custom scanning profiles in Nuance's PaperPort 14.5 (http://www.experts-exchange.com/articles/17490/). But the ability to create custom scanning profiles a…

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now