Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WSH Odd Behaviour in Debugger
Message
From
07/12/2001 15:56:43
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00591305
Message ID:
00591444
Views:
35
>No, it's an ongoing problem with the first reference to the property of a COM object that hasn't been pre-registered through a wrapper; the properties of a COM object are only made visible after they've been examined once, at least in some versions. The following might help - rather than indexing explicitly, try a FOR...EACH construct, like:
>
>
lIsMapping = .t.
>oNet = CREATEOBJECT("WScript.Network")
>oNetDrives = oNet.EnumNetworkDrives
>FOR Each ItemValue IN oNetDrives
>   IF lIsMapping
>      ? ItemValue && Displays the drive mapping
>   ELSE
>      ?? ' = ' + ItemValue && Displays the share
>   ENDIF
>   lIsMapping = ! lIsMapping
>ENDFOR
>
>You could use similar techniques to populate a two-dimensional array of drives and mappings

Ed,

That was it! Not sure I understand the nuances of the versions and exactly why the previous code didn't work, but I will soon... Thanks!

Renoir
Previous
Reply
Map
View

Click here to load this message in the networking platform