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

Running VFP 9 code through FPW 2.6

Status
Not open for further replies.

tkee

Programmer
Feb 6, 2004
55
0
6
US
We have a legacy program built with FPW 2.6 and another running on Oracle that need to be able to exchange and update data. We have been able to connect and manipulate data as needed using VFP 9, but we need to be able to do it from within the FPW program. Rewriting the FPW 2.6 program is not a current option, and we are just learning VFP 9. Is there a way to run a VFP 9 exe from the FPW program, or is there a better option? What would be necessary to set it up?
 
Tkee,

Is there a way to run a VFP 9 exe from the FPW program

You can certainly run a VFP EXE as an external application, but I'm not sure if that's what you want. I suggest you try this:

Code:
DECLARE INTEGER ShellExecute IN shell32.dll ; 
  INTEGER hndWin, ; 
  STRING cAction, ; 
  STRING cFileName, ; 
  STRING cParams, ;  
  STRING cDir, ; 
  INTEGER nShowWin

cFileName = "c:\MyProgs\My_VFP9_Prog.EXE" 
cAction = "open" 
ShellExecute(0,cAction,cFileName,"","",1)

The VFP program will run in it own window, and will provide very little in the way of communication with your FPW program. But it should run OK.

Is that any help?

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
If all you need to do is write a VFP9 program to excahnge data, Do it. Make all the DATA table you want in VFP9, Just make sure your output in is
COPY TO .... TYPE FOX2X
The 2.6 Program can then use the output tables.

99% of all 2.6 code runs directly from VFP with no alterations. NOTE the word >>CODE<<

Considerations are
1. You CAN NOT use a 2.6 table exclusive.
But you can copy it to a temp file and use the temp file exclusive.

2. You can not run a 2.6 report.
Well You can but the output may not be what you want and the report can not be run in 2.6 ever again.

3. You can not run a 2.6 menu,
Well again yes you can, but once you do you can not go back to 2.6 - Exception You can run the compiled menu as a PRG.

4. You can not use a 2.6 Project file.
If you do you can not go back. - Unless you make a new project file in 2.6.

5. You can run any other 2.6 PRG, Screen, or Form with no problems.









David W. Grewe Dave
 
Mike,

Did you intend that your sample code could be run from a FoxPro Windows 2.6a prg? I got a syntax error on the first line when I tried it. Or am I misunderstanding your response to Tkee?

Teresa
 
Teresa,

Yes, I did intend it to run from FPW 2.x.

But it's many years since I used 2.x. I believe the DECLARE command was available in those days, but maybe my memory is deceiving me. If so, my apologies.

One technique which I know for sure was in 2.x was the RUN command. Tkee should be able to use that to run the VFP app.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Mike said:
But it's many years since I used 2.x. I believe the DECLARE command was available in those days, but maybe my memory is deceiving me. If so, my apologies.
Mike,

No need to apologize. This has given me an idea for something to try in one of my legacy 2.6a apps (even if it uses the RUN command instead of something fancier...)

BTW, there is a DECLARE in 2.6a but it is for arrays. There is no DECLARE for dlls in 2.6a.

Teresa
 
How about a different approach:

We have been able to connect and manipulate data as needed using VFP 9, but we need to be able to do it from within the FPW program.

Why not compile the FPW program in VFP9. You can most Definitely run FoxPro for Windows in VFP9. This way you do not need to rewrite the FPW program...VFP9 can make up for the limatations of FPW,
But keep in mind Daves "Considerations"...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top