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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP9 Setup Problems

Status
Not open for further replies.

k2a

Programmer
Jun 26, 2012
133
0
0
DE
Hi all,
My W7-32bit System is down and i had to install VFP9 on a W7-64bit System. After moving my apps to the new system and setup the search path but when I load a project a bunch of files cannot be found.
Such as wzedit.msk, wzclose.msk, _cancel.bmp, _save.bmp and more. Could it be that some are located in xsource.zip, which I did not unzip yet?
I would be very glad for any advice.
Klaus
 
As such files (wzedit.msk) belong to VFP's HOME() folder, the pjx information holding the path to files may need an update, when you did install into "Program Files (x86)" now, whereas your old PC was only having "Program Files" without the (x86) extension.

In many code using ffc classes VFP makes use of the HOME() function, but this can't be in the projects files path/name information, so this fails for such a move from 32bit to 64bit standard path of program files.

You can adapt your PJXes once. It may also have to do with some files being in xsource, yes, but I assume mainly because of the (x86) suffix. It's not the only downside of ffc class usage.

Bye, Olaf.
 
[tt]USE your.pjx[/tt] and then [tt]BROWSE FOR "Program Files" $ Name[/tt] to see which file names to adapt to the new HOME() folder.

Bye, Olaf.
 
Olaf, your are right the pjx information holding the path to files without the (x86) extension.
When opening a form it tries to locate the path C:\Program Files\Microsoft Visual FoxPro 9\wizards\wizembss.vcx.

Should the search path in Options > Tools > File Locations fix that problem? Or do i have modifiy each form.

Klaus
 
It should be obvous you can't just fix the path in options/file locations, how would you do so? If you put in the path as per your project, VFP and all its files ISN'T THERE!!
You HAVE to fix the PJX informations and perhaps also VCX/SCX (can be modified in the same manner via USE), the project files and form objects have to point to really existing files. Changing th file location for Home() doesn't move VFP nor does changing settings for wizards and other things, file locations can be adapted to changing file locations, but obviously the files must be where you set the locations.

That's the trouble you inherit with using VFPs classes, HOME() is not HOME() everywhere and all time. If you have too many paths to change, look out for HACK SCX/VCX -
Bye, Olaf.
 
Should the search path in Options > Tools > File Locations fix that problem? Or do i have modifiy each form.

When you open the project, locate the first file that can't be found. VFP will look in that location for subsequent files. You'll have to do this once for each folder involved.
 
Dan Freeman said:
VFP will look in that location for subsequent files.
That's true, you only have to fix the first question - for each main folder being wrong. But that's only for project files and not yet for any object/control on forms and there are quite a lot folders, still.

When having the question to locate a class on a form I often had the experience I had to manually save that change (CTRL+S) before it's really changed, this change does not cause the usual confirmation prompt, whether you're sure to close without saving changes. I would even say I better had to move a control one pixel forth and back to make the save work. The sneaky thing is, you don't recognize this within the same VFP session, reopening the form VFP still knows the PATHs he remembered as corrections, but next session you see those promised changes are not saved, if you don't do so yourself.

Instead of doing this manually acting on the data is faster, you can do so with an UPDATE or REPLACE. You can act on all project files via [tt]Foreach loFile in _vfp.ativeproject.Files[/tt] - or you use the hackscx/vcx tool.

Bye, Olaf.
 
Olaf, thanks for your hints.
Just checked some forms and in the ClassLoc the path there are all without the (x86) extension.
It would be allmost impossible to modify all these manually. You gave me some ideas how to fix it faster.

The hackscx/vcx tool seems to be something for experts for i could not find a discription how to install and use it.
So i would like to use the UPDATE or REPLACE methode that seems to be much easier for me.

Do you think i could do it using Table > Replace Field > Scope All > For cause expl. on ClassLoc?
Or maybe give me some advice because you are much more profession then anybody else.

Klaus
 
You already discovered classloc, that's the field to mend in both VCX and SCX, In PJX you need to mend the Name field.

You have to apply
Code:
Update anscxorvcx Set classloc=STRTRAN(classloc,"C:\Program Files\","C:\Program Files (x86)\",1,1,3)
and
Code:
Update thepjx Set Name=STRTRAN(Name,"C:\Program Files\","C:\Program Files (x86)\",1,1,3)

To apply the first update to any SCX and VCX of your project do
Code:
Clear All
For Each loFile in _vfp.activeproject.Files
   If loFile.Type $ "KV" && SCX and VCX files only.
       Use (loFile.Name) In Select("anscxorvcx") Alias anscxorvcx
       Update anscxorvcx Set classloc=StrTran(classloc,"C:\Program Files\","C:\Program Files (x86)\",1,1,3)
   EndIf
EndFor
Clear All

To apply the second update, well, USE your.pjx ALIAS thepjx, then do the update.

You might have some rest in PRG code, but I don't think so, if so it'll mostly use HOME(), and that transfers correctly to wherever VFP is installed and will lead to files put into the pjx and be included in your final EXE.

Bye, Olaf.
 
Just opened the form abgleich.scx and run the following statement in the command window:
Update abgleich.scx Set classloc=STRTRAN(classloc,"C:\Program Files\","C:\Program Files (x86)\",1,1,3)
The cursor moved from top to buttom but the classloc remains unchanged.

Did i do anything wrong?

Klaus
 
Sorry Olaf, but i realy do not understand how to use the update you gave me below. Where should i execute it?

To apply the first update to any SCX and VCX of your project do
CODE

Clear All
For Each loFile in _vfp.activeproject.Files
If loFile.Type $ "KV" && SCX and VCX files only.
Use (loFile.Name) In Select("anscxorvcx") Alias anscxorvcx
Update anscxorvcx Set classloc=StrTran(classloc,"C:\Program Files\","C:\Program Files (x86)\",1,1,3)
EndIf
EndFor
Clear All

Regards, Klaus
 
This is not applied somewhere, you run this, once, while you have your project open in the IDE.

Bye, Olaf.
 
Olaf please ignore the last post!

It is now clear that the code has to run in a seperate program and it did make the conversion.
Your clever program saved me alot of work. Thanks so much!

In the other post, where i told you the statement did not work from the command window, was because the
path name did not start with "C:".

Regards
klaus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top