Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Last try... VFP EXE ?
Message
From
09/10/2001 11:39:56
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00565960
Message ID:
00565998
Views:
15
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform