do form.scx in exe from prg outside of exe 
Author Message
 do form.scx in exe from prg outside of exe

I have run into a problem. When working on the conversion of a foxpro 2.6
program to vfp 6, I recreated the forms that used to be myform.spr
(programs) into myform.scx forms in vfp. I have some utilities that my end
user has to run that sometimes has to bring up forms that are in the exe,
for example

myapp.exe (contains myform.scx inside of exe)
mycustomersutility.fxp (has "do form myform.scx" inside of the code)

I am getting a file error#3 - file not found. How can I get around this and
be able to call a form in the exe from an outside fxp. I have found that I
can successfully call a program that's in the exe from the outside fxp but I
can't seem to figure out how to call the form. Any ideas would be greatly
appreciated!

From: Ed Johnson



Tue, 07 Sep 2004 07:48:26 GMT  
 do form.scx in exe from prg outside of exe
Well, if you're shipping him the EXE and not including the forms' files in
that directory, that may be the cause, or possibly, the older programs are
expecting the old forms, and not finding them. Try making sure the files are
actually there, and not just compiled within the EXE.



Quote:
> I have run into a problem. When working on the conversion of a foxpro 2.6
> program to vfp 6, I recreated the forms that used to be myform.spr
> (programs) into myform.scx forms in vfp. I have some utilities that my end
> user has to run that sometimes has to bring up forms that are in the exe,
> for example

> myapp.exe (contains myform.scx inside of exe)
> mycustomersutility.fxp (has "do form myform.scx" inside of the code)

> I am getting a file error#3 - file not found. How can I get around this
and
> be able to call a form in the exe from an outside fxp. I have found that I
> can successfully call a program that's in the exe from the outside fxp but
I
> can't seem to figure out how to call the form. Any ideas would be greatly
> appreciated!

> From: Ed Johnson



Tue, 14 Sep 2004 01:21:59 GMT  
 do form.scx in exe from prg outside of exe
Yes I am including an EXE that has the programs and form files all included
inside. The thing that bugs me is that I can run programs that are in the
EXE from FXPs that are outside of the exe andrun using "Do" statements but I
can't seem to run any forms with do form. How can I get around this?

From: Ed Johnson


Quote:
> Well, if you're shipping him the EXE and not including the forms' files in
> that directory, that may be the cause, or possibly, the older programs are
> expecting the old forms, and not finding them. Try making sure the files
are
> actually there, and not just compiled within the EXE.



Sat, 18 Sep 2004 09:39:29 GMT  
 do form.scx in exe from prg outside of exe
The syntax of DO FORM does not support the running of forms in other
EXEs.  What we do is create a function in the main prg in the EXE that
calls the form.

"main.prg" of EXE
Procedure RunTheForm
Parameters lcWhichForm, param1, param2, param3, param4, ...
Do Case
   Case lcWhichForm = "MyForm"
      Do Form MyForm ...  With param1

   Case lcWhichForm = "MyOtherForm"
      Do Form MyOtherForm ....  With param1, param2, param3

   ...

EndCase

The external call would be something like:
#Define RUNTHEFORMPROC "RunTheForm"
#Define OTHEREXE "other.exe"
Do (RUNTHEFORMPROC) In (OTHEREXE) With "MyForm", 1

Andrew

Quote:

> Yes I am including an EXE that has the programs and form files all included
> inside. The thing that bugs me is that I can run programs that are in the
> EXE from FXPs that are outside of the exe andrun using "Do" statements but I
> can't seem to run any forms with do form. How can I get around this?

> From: Ed Johnson



> > Well, if you're shipping him the EXE and not including the forms' files in
> > that directory, that may be the cause, or possibly, the older programs are
> > expecting the old forms, and not finding them. Try making sure the files
>  are
> > actually there, and not just compiled within the EXE.



Mon, 20 Sep 2004 02:20:00 GMT  
 do form.scx in exe from prg outside of exe
Thanks andrew - that's helpful and seems to work.

From: Ed Johnson


Quote:
> The syntax of DO FORM does not support the running of forms in other
> EXEs.  What we do is create a function in the main prg in the EXE that
> calls the form.

> "main.prg" of EXE
> Procedure RunTheForm
> Parameters lcWhichForm, param1, param2, param3, param4, ...
> Do Case
>    Case lcWhichForm = "MyForm"
>       Do Form MyForm ...  With param1

>    Case lcWhichForm = "MyOtherForm"
>       Do Form MyOtherForm ....  With param1, param2, param3

>    ...

> EndCase

> The external call would be something like:
> #Define RUNTHEFORMPROC "RunTheForm"
> #Define OTHEREXE "other.exe"
> Do (RUNTHEFORMPROC) In (OTHEREXE) With "MyForm", 1

> Andrew




- Show quoted text -

Quote:
> > Yes I am including an EXE that has the programs and form files all
included
> > inside. The thing that bugs me is that I can run programs that are in
the
> > EXE from FXPs that are outside of the exe andrun using "Do" statements
but I
> > can't seem to run any forms with do form. How can I get around this?

> > From: Ed Johnson



> > > Well, if you're shipping him the EXE and not including the forms'
files in
> > > that directory, that may be the cause, or possibly, the older programs
are
> > > expecting the old forms, and not finding them. Try making sure the
files
> >  are
> > > actually there, and not just compiled within the EXE.



Sun, 26 Sep 2004 00:11:59 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Running outside exe's from FPW26

2. EXE won't run outside of development environment

3. Fox.exe, Foxprox.exe, or FoxPro.exe?

4. Prg to exe

5. Prob: Can't run .prg file from within .exe for FPM

6. prg to exe

7. prg -> exe

8. Executing a prg from a stand alone exe

9. Can foxBASE+ compile prg to exe?

10. Building an EXE with just a simple .prg

11. FPD 2.6 .exe issue - .prg compilation

12. How to turn small PRG to EXE

 

 
Powered by phpBB® Forum Software