Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Declare dll if it exists
Message
De
31/03/2009 17:10:59
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Divers
Thread ID:
01392477
Message ID:
01392500
Vues:
61
>>>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 "".

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform