Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using variables
Message
From
08/10/1998 13:20:12
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00144971
Message ID:
00145118
Views:
36
>Ed,
>
>Thanks for the speedy update.
>

No problem. I did notice that it is not safe to assume that, if a special folder like "My Computer" or "Dial-Up Networking" is selected, a valid folder can be returned at all; in the case of "My Computer", all local resources have an entry in it's Items collection, and in the case of "Dial-Up Networking" (which should be blocked by setting BIF_RETURNONLYFSDIRS in the flags parameter, but I haven't tested this exhaustively), there is no folder at all - a Registry Hive reference exists instead. A little defensive coding would be a good idea here; the FAQ code was intended to show how to use the Shell.Application object's BrowseForObject method to return a Folder object, and how to manipulate a Folder object's Items collection.

Returning an empty string (or in my actual production implementation, a NULL, so that I can test the return with ISNULL() to trap unusable results or no selection made by the user) is probably the safest course of action, unless you want to add code to handle all the Special Folders cases.

>>You can trap it by using the following in place of the FOR EACH loop in the FAQ code:
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
Reply
Map
View

Click here to load this message in the networking platform