Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Net Use to map a drive?
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00146250
Message ID:
00146642
Views:
27
>>Thanks for the reference, John. What I'm doing at this point is incorporating the use of the support objects from Wscript and scripting-related automation objects into VFP - in particular, the Wscript.Shell, Wscript.Network, and the various ADSI components are incredibly useful in accessing things in various APIs that would otherwise require wrapper .DLLs and significant coding to make their functions available; for example, getting the functionality of WNetAddConnection2() rather than WNetAddConnection(), is much easier using the Wscript.Network object than writing the wrappers needed to make the API call itself.
>>
>>I'm playing a bit with the ADSI 2.5 object set, and will let you know how it goes making that available to VFP as well. The biggest issue I have is in ensuring that it installs properly - Wscript is a piece of cake, since it can install cross-platform unambiguously, but ADSI is a bit trickier to get set up right.
>
>
>Yeah, I'm real interested too. I started an application that creates users for NT and hoped to be able to use WSH, but couldn't get a handle on the wscript object in some of the sample code. Instancing objects of .shell or .network are not a problem but some of the sample code that references a wscript object wouldn't work. If you can figure that out, let me know how you did it. Of course, it might have something to do with me running on NT Workstation and not testing the code on one of my servers. I just haven't had time to try it and haven't installed adsi and wsh on my servers.

Unfortunately, large parts of the Wscript functionality are only exposed to running instances of CSRIPT/WSCRIPT, and thus can only be used internally in scripts. I'm playing with ADSI, and think I can expose the ADSI objects inside of a VFP app, but haven't yet gotten things quie right. What I have done is launched Scripting Host scripts from inside a VFP app using CreateProcess(); I have VFP create the script file and then launch it using my API process class (you can take a look at the FAQ entry I did on LaunchAppAndWait() to see the general approach; I've working on a VCX that'll expose the CreateProcess() and ShellExecute() functionality in a more VFP-ish fashion.) I use volatile registry keys to pass results back from the script to the running VFP task.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform