Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Last try... VFP EXE ?
Message
De
09/10/2001 11:39:56
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00565960
Message ID:
00565998
Vues:
16
>HI, last try...
>
>how do I know if an .EXE file is a VFP exe before call it ?
>
>I got answers that pointed to use AGETFILEVERSION() function and to use the DEBUG command...
>any other?

Here's a thought: I just opened 3 VFP applications in Notepad, and after the usual gibberish, there seems to contain readable strings, most likely function declaration or something. Within those, the string "VisualFoxProRuntime.6" can be found.

So you could open the file using FOPEN(), then look for the "VisualFoxProRuntime.6" string.

Here's a little code that I just made up and that seems to work:
#DEFINE	C_STRING	"VisualFoxProRuntime.6"

LOCAL x, y

x = FOPEN(GETFILE("EXE"))
FSEEK(x, 5144)  && The "signature" seems to be at position 5144
y = FREAD(x, LEN(C_STRING))

IF y == C_STRING
	MESSAGEBOX("VFP signature found!")
ELSE
	MESSAGEBOX("Sorry, this is not a VFP executable!")
ENDIF

FCLOSE(x)
Note that while it appears to work on VFP6 executable, there is no guaranties (sp?) that it will work on another version of VFP.

HTH!
Sylvain Demers
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform