El siguiente codigo fue obtenido de los newsgroups de VFP en ingles:
**************************************************
* Subject. Re: Identifying the versions of VFP used to build an EXE or DLL
* Sender: Rick Bean rgbean@unrealmelange-inc.com
* Date: 04/11/2004 8:01
* newsgroup: microsoft.public.fox.programmer.exchange
**************************************************
Hay que hacer notar que funcionara con ejecutables desde FoxPro para Windows, hasta el VFP9b.
************************************************** * Funcion: GetFoxEXEVersion * Obtiene la version en que fue compilado un EXE * Autor: Rick Bean rgbean@unrealmelange-inc.com * Ejemplo: ?GetFoxEXEVersion(GETFILE("EXE")) ************************************************** * GetFoxEXEVersion.prg FUNCTION GetFoxEXEVersion LPARAMETERS p_cEXEName DIMENSION VersionInfo[8,3] VersionInfo[1,1] = "FPW 2.5" VersionInfo[2,1] = "FPW 2.6" VersionInfo[3,1] = "VFP 3.0" VersionInfo[4,1] = "VFP 5.0" VersionInfo[5,1] = "VFP 6.0" VersionInfo[6,1] = "VFP 7.0" VersionInfo[7,1] = "VFP 8.0" VersionInfo[8,1] = "VFP 9.0" VersionInfo[1,2] = "foxw" VersionInfo[2,2] = "foxw" VersionInfo[3,2] = "VisualFoxProRuntime.3" VersionInfo[4,2] = "VisualFoxProRuntime.5" VersionInfo[5,2] = "VisualFoxProRuntime.6" VersionInfo[6,2] = "VisualFoxProRuntime.7" VersionInfo[7,2] = "VisualFoxProRuntime.8" VersionInfo[8,2] = "VisualFoxProRuntime.9" VersionInfo[1,3] = "00D1" VersionInfo[2,3] = "0111" VersionInfo[3,3] = "" VersionInfo[4,3] = "3228" VersionInfo[5,3] = "1418" VersionInfo[6,3] = "162C" VersionInfo[7,3] = "1638" VersionInfo[8,3] = "10EC" && beta 1 LOCAL lnii, lcVersion, lnHandle, lcKeyName lnHandle = FOPEN(p_cEXEName, 0) IF lnHandle < 0 RETURN "Unable to Open file" ENDIF lcVersion = "(unknown)" FOR lnii = 1 TO 8 IF !EMPTY(VersionInfo[lnii,3]) = FSEEK(lnHandle, EVALUATE("0x"+VersionInfo[lnii,3])) lcKeyName = VersionInfo[lnii,2] IF FGETS(lnHandle, LEN(lcKeyName)) == lcKeyName lcVersion = VersionInfo[lnii, 1] EXIT ENDIF ENDIF ENDFOR =FCLOSE(lnHandle) RETURN lcVersion
Espero les sea de utilidad.
Espartaco Palma Martinez
Excelente! Muchas gracias!
ResponderBorrar