>>>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))
> 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.