Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Declare dll if it exists
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01392477
Message ID:
01392720
Views:
82
>>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?
>
>Joe,
>
>You can use following code
>
>DECLARE long LoadLibrary IN WIN32API String
>DECLARE Long FreeLibrary IN WIN32API Long
>
>lcDllName = "Wtsapi32.dll"
>
>lnLibHandle = LoadLibrary(lcDllName)
>
>IF lnLibHandle  <> 0
>	*? "TS"
>	DECLARE Long WTSQuerySessionInformation in Wtsapi32.dll	
>	= FreeLibrary(lnLibHandle)
>	*...
>ELSE
>	*? 'Not TS"	
>ENDIF	
>
>
>BTW, I'm running WinXP SP3 and Wtsapi32.dll is present on my system.


Very nice! Thank you! I'm not sure why but some of our users get an error about wtsapi23.dll being missing. It's not needed unless they are running on wts so that's why I want to conditionally load it.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform