>>>I have an app that runs in winxp desktops and also terminal server. If running on terminal server it needs to "declare integer WTSQuerySessionInformation in Wtsapi32.dll". If the app is running on xp it needs to skip this as it won't exist. What is a good way to determine how to load this dll or not?
>>
>>Is FILE() function didn't work for you?
>>
>>IF FILE("Wtsapi32.dll")
>> DECLARE ....
>>ENDIF
>>
>
>I don't think file() will find it in the windows system directory?
I don't know, maybe you do think so. If you do, you're right, it won't - file() is scoped to Fox's path, not the DOS path. But you can use Tracy's way, or write a loop
lcPath=getenv("path")
lcFile=""
for i=1 to getwordcount(lcpath, ",;")
lcP1=getwordnum(lcPath, i, ",;")
lcFile=forcepath("Wtsapi32.dll", lcP1)
if file(lcFile)
exit
endif
endfor
return lcFile
Instead of this specific dll you can make pass any filename as a parameter, and if it's there you'll get the full path to it, or else "".