Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Closing an OLE server 2

Status
Not open for further replies.

webmonger

Programmer
Joined
Mar 13, 2004
Messages
66
Location
AU
I create a report with pictures on it from a General field in a cursor.

The Gen field in my cursor is created by writing a 'Thumb' Memo field containing a jpg image to a temp jpg file with strtofile() then APPEND General etc

My system uses a CorelPaint process during this routine - shos as photopnt in

Initially it crashed but I discovered up to 8 photopnt processes open.

Adding a delay before each APPEND General I have reduced it to two processes with an occasional third one. They open and close automatically as shown in the Task Manager window.

However I often get one process left after running the routine.

Is there a way to find the process that is open after an APPEND and force a closure?

Perhaps I could remove the delay then?

Thanks
 
Usually when I am using an OLE Server that I have made, Word.exe, or whatever I first look if the object itself has a method for quitting such as Quit() or Exit(). Then I will set my instance of that object to .NULL. and then I will release it. Such as:
Code:
oOLEServerInstance.Quit()
oOLEServerInstance = .NULL.
Release oOLEServerInstance
...these steps usually insure that the object is properly released and that there aren't any dangling references left in memory. If there is no quit method of the object then I just do the last two lines of code.

I'm sorry I can't give you a more specific example to your problem but I must profess to not having ever used CorelPaint as an Automation server in any of my projects.

boyd.gif

craig1442@mchsi.com
"Whom computers would destroy, they must first drive mad." - Anon​
 
webmonger

You can resolve your problem with 'Closing an OLE server' by not creating one in the first place and instead use the Picture/ActiveX control in a report.

It's unnecessary to use a general field simply to be able to print a report containing .jpg images.

The Picture/ActiveX control supports .jpg and other image file types depending on which version of VFP you are using.

If you need help in using a table with a field containing the path\filename.ext of your image files, I suggest you start a new thread in the Microsoft: VFP - Databases, SQL, and Reports Forum - forum1252.

FAQ184-2483 - answering getting answered.​
Chris [pc2]
PDFcommandertm.com
PDFcommandertm.co.uk


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top