Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP 7 bug on SET RESOURCE command
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00657030
Message ID:
00657601
Views:
29
George,

thank you for reply.

>Now whether or not it's a bug is another question completely. It could be that the OS is not releasing the file handle properly when the SET RESOUCE TO command is issue. Last night I was able to demonstrate that under Win98SE. Also, if the application resides on a Novell network, that OS is notorious for being slow in this process.

Jim Saunders from Microsoft VFP support replies to this report today as follows:

"Apparently, the file gets partially opened in the system datasession
when doing the SET RESOURCE, and does not get closed until you exit and
restart VFP. "

So it seems to be an VFP issue if it tries to use a corrupted resource file?

>My question would be, "Is there any reason why the resource file is included with the executable?"
>
>To me, this is sort of like asking for a problem. I know that there are instances where people supply resource files in order to control things like the Print Preview toolbar. Including it with the setup, but excluding it from the exe would solve the problem.
>
>I would think, however, because you've included it in the exe, that you have a need to do so. In that light, I'd make the following suggestion.
>
>1. Include the resource file in the executable and either change its name or the name in the config.fpw file.
>
>2. On startup, SET RESOURCE OFF, open the dbf indicated in the config.fpw file and append into it from the included dbf, then reset with SET RESOURCE TO < filename > You could then delete it on shutdown, if necessary.

I need need to remember the settings of memo, modify file, modify command and modify report windows. User can change them (position, size, font, wrapping, etc.) at run time.
The only way to to this is use the resource file not included in exe file.

Using your suggestion, all settings are reset at application startup.
This is not acceptable.

The only way seems to dedect a corrupted resource file before using SET RESOURCE and fix it or reset to default it only in case of corruption:
select 0
on error lError=.t.
use myresource excl
pack  && this line is required to dedect fpt corruption caused by VFP crash
use
on error
if m.lError
  create table myresource ( type c(12), id c(12), name M, readonly L, ;
          ckval n(6), data M, updated D )
  use
  endif
set resource to myresource
I don't like to add this code to my application startup since
PACK command slows down startup a lot!

Is there a simpler solution ?

I expected that VFP will create a new empty resource file in this
case as it prompts.
However, VFP does not recover from this error.
Andrus
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform