Wiki Home

Run Form From Exe


Namespace: VFP
Hello.

I have a form that this in an EXE and me wants to call that form from another EXE.... can one make?

Joseph.


Sure, try this for example:

*-- Nothing up my sleve
CLEAR ALL
SET PROCEDURE TO 

*-- Make an EXE
TEXT TO lcCode NOSHOW
  DEFINE CLASS MyForm AS Form
    Caption= "I am a Form buried in an EXE"
  ENDDEFINE
ENDTEXT
STRTOFILE(lcCode,"Test20a.PRG")
BUILD PROJECT Test20 FROM "Test20a.PRG" 
BUILD EXE Test20 FROM Test20


*-- Get the form from the EXE
SET PROCEDURE TO Test20.EXE
PUBLIC x
x= CREATEOBJECT("MyForm")
x.Visible=.T.


Thank you, Sergey

Yes, but would have to transform all the forms into classes ?
If your forms aren't classes, you could create a PRG or function that is bound in the EXE to run the form:

FUNCTION RunForm(cFormFile)
   DO (cFormFile)
ENDFUNC


-- Ryan Katri

Thank you, Ryan.
As I can make to execute a function from another EXE because the Set Procedure To MiFile.EXE it doesn't work


Category Code Samples
( Topic last updated: 2004.04.16 12:26:09 PM )