Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Andreas Jaeger
  Where is Andreas Jaeger?
 Poecking
 Germany
 Andreas Jaeger
 To: Koen Piller
  Where is Koen Piller?
 Santpoort-Zuid
 Netherlands
 Koen Piller
 Tags
Subject: RE: close file with low level command
Thread ID: 154264 Message ID: 154565 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Win32API programming
Date: Monday, December 17, 2007 11:01:30 PM         
   


Dear Koen,

just to make sure, that teh problem is understood right:

the application is running in a directory e.g. c:\programs\eis-system
the images are stored in the directory c:\programs\eis-system\images

via set path to c:\programs\eis-system; c:\programs\eis-system\images the pathes where the application is searching the files are defined.

The program opens a form with an image objects, which will be defined in the init event of the form e.g. thisform.image1.picture = "picture1.jpg",
where "picture1.jpg" is located in the directory c:\programs\eis-system\images

With closing the form through thisform.release the image will be not released and canĀ“t be modified e.g. renamed in the windows explorer.

In case if I am calling the image with thisform.image1.picture = "c:\programs\eis-system\images\picture1.jpg" everything works fine and with closing the form, the image will be released without any problems.

This bahviour also causes over time if many forms with pictures will be called a slow down of the system, there files will be not released, and sooner or later windows starts to cache programs. By monitoring the memory consumption with the task manager this is clearly to detect.

Andreas





> > Of some reason you make me think about the whole situation in a different way. I spend almost all the weekend to go step by step through the code and could finally fix it. From my point of view this is a bug in VFP. So here the solution:
> >
> > During start-up I set several paths (with set path to pathe1, path2 etc.) where the program should search the images. As a consequence I am using the image object only with the file name (e.g. picture1.jpg) without path to open the picture, e.g. thisform.image1.picture = m.picture, where m.picture is an variable containing the image name (see above). With closing the form or object the image will be not closed, exept the default path is identic with the path where the image is located, what was not the case.
> >
> > In the case I am opening the image with the full path in the variable everything works fine and with closing the form or object the image object will be released as well and could be als renamed in windows explorer.
> >
> > Andreas
> >
> > P.S. clear all does not help to solve this problem
> >
> >
>
> Andreas,
> first of all, do I understand correctly your problem is solved? If so, glad to know.
> If it I understand that your problem is not the way VFP is releasing a form but your renewed statement set('path') is not correctly at least not to your expectations executed. If my first conclusion is .f. please upload the renewed / refreshed "set('path')" method.
> Best regards,
> Koen

ENTIRE THREAD

close file with low level command Posted by Andreas Jaeger @ 12/13/2007 8:22:16 PM
RE: close file with low level command Posted by Barbara Peisch @ 12/13/2007 8:32:18 PM
RE: close file with low level command Posted by Andreas Jaeger @ 12/13/2007 11:39:57 PM
RE: close file with low level command Posted by Andreas Jaeger @ 12/13/2007 11:45:09 PM
RE: close file with low level command Posted by Barbara Peisch @ 12/14/2007 1:27:20 AM
RE: close file with low level command Posted by Andreas Jaeger @ 12/14/2007 5:40:16 PM
RE: close file with low level command Posted by Barbara Peisch @ 12/14/2007 9:13:02 PM
RE: close file with low level command Posted by Andreas Jaeger @ 12/17/2007 7:49:36 PM
RE: close file with low level command Posted by Barbara Peisch @ 12/17/2007 8:16:37 PM
RE: close file with low level command Posted by Koen Piller @ 12/17/2007 8:19:02 PM
RE: close file with low level command Posted by Andreas Jaeger @ 12/17/2007 11:01:30 PM
RE: close file with low level command Posted by Koen Piller @ 12/13/2007 8:34:53 PM
RE: close file with low level command Posted by Andreas Jaeger @ 12/13/2007 11:42:13 PM
RE: close file with low level command Posted by Tamar Granor @ 12/13/2007 10:23:35 PM
RE: close file with low level command Posted by Andreas Jaeger @ 12/13/2007 11:43:01 PM