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

Using legacy VFP 6 program with Windows 7

Status
Not open for further replies.

tkee

Programmer
Feb 6, 2004
55
US
We have an old program we need to use for one department. We do not have the source code. It was written in VFP6 and runs fine on our old XP computers. However, we have to upgrade everyone to Windows 7. The EXE throws Error 11 (Function argument, value or type is invalid) and gives the program and line number. I can run the program on my Windows 7 PC with no error, but I am a developer and have VFP 9 installed on mine. What would be different on Windows 7 than XP or Windows 7 with VFP installed? Are there some support files or updates that are installed when installing VFP 9 that are needed to run the older legacy program? The Windows 7 machines are set up identically other than having VFP 9 on mine.
Thanks for any insights.
 
Tkee,

consider how many days you are now dealing with this, buy Refox and you have the original code. - 1 hour inclusive download of Refox
Than you can 1st try to see how this application runs under VFP9SP2, and or try to correct your error(11)

Regards,

Jockey(2)
 
By chance, are the W7 computers that AREN'T your computer 64 bit? There are some functions that throw those sorts of errors on 64 bit machines but run fine on 32 bit. SYS(3050) comes to mind.



-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Could the application be looking for a drive letter (F:\Applications\FoxProApp\...) that hasn't been defined in the new Windows 7 PC's that is there in the older PC's? I've run into that problem before even though VFP 6 can handle longer server names.
 
Another thought is are you passing a parameter with any spaces in it? Like maybe a path name or file name? Something that may need quotes around it?
There may also be a piece of code using (MyVariable) instead &MyVariable involved.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
If you don't have the source code, you might try using a decompiler. I bought one to use for one of my clients and it worked fantastically. Extracted screens, reports, etc. and allowed me to continue to develop for them without losing any functionality. They're not cheap but worth it if you do a lot of VFP consulting :)

Alternatively, I wrote a simple program in VFP 9 that took a single string parameter which it would then run. I could then install VF9 runtimes and run VFP6 exes using the following :-

dovfp9 "do vfp6_app.exe"

I wrapped it in an error handler to catch certain things (like enginebehaviour issues) and also added memory management code since VFP struggles on machines with too much memory unless you're careful.

Works for me. I've got VFP applications running on Windows 8.1 64bit with 16GB of RAM without issue. Hope that helps,

Rob Spencer
Caliptor Pty Ltd
 
BTW Dave, I use the following code on all my machines as it stops me having issues when the system has too much RAM. What I found was that VFP was setting the Foreground buffer pool to greater than the memory it could access. If I detect it, I limit the pool size to something reasonable.

Code:
**********************************************
procedure checkMem ()
**********************************************
* ------------ Limit Memory Usage ------------
local nTotMem, nFGMem, nBGMem

nTotMem= val(sys(1001))
nFGMem= val(sys(3050, 1))
nBGMem= val(sys(3050, 2))

if m.nTotMem < m.nFGMem
	* Adjust the pool sizes
	sys(3050, 1, m.nTotMem / 3)	&& Foreground buffer pool
	sys(3050, 2, min(m.nTotMem / 3, m.nBGMem))	&& Background memory pool
endif
endproc	&& checkMem()

Hope that helps,

Rob Spencer
Caliptor Pty Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top