Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Name of executing DLL
Message
De
09/11/1999 10:57:43
 
 
À
28/09/1999 15:44:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00260223
Message ID:
00289036
Vues:
34
>>>I have created a DLL that I need to get the version number from. The problem is, FullPath(Sys(16,0)) returns the name of the class library file (d:\myappdir\mylib.vct), and there is no version information associated with it. If I do AGETFILEVERSION(myarr,"mylib.dll") it works just fine. Of course everything works when you try it from the command window. TIA
>>
>>One way to do this is to look in the registry for HKEY_CLASSES_ROOT\ProgID\CLSID, which will contain the GUID for the server. The registry key HKEY_CLASSES_ROOT\CLSID\GUID\InProcServer32 will contain the full path of the .DLL file.
>A follow up to this Q: It turns out that if you execute the same code but in a PRG instead of a VCX the correct info is returned. Like so:
>
>Define Class prgver as Custom OlePublic
>	Proc version
>		Local lArr, lnResult, lcPath
>		Declare lArr(15)
>		lcPath = Sys(5) + Sys(2003) + "\" + Justfname(Sys(16))
>		lnResult = AGetFileVersion(lArr, lcPath)
>		Return Transform(lArr(4))  && Version Number
>	Endproc
>Enddefine
>Go figure! Thanks for your help.
It turns out, after reading Calvin Hsia's whitepaper on VFP servers from www.seattlevfp.org that the code above can be greatly simplified by the use of the new _VFP.Servername property. It will work for EXE COM servers too. Just change to lcPath = _VFP.Servername.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform