Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems calling WNetOpenEnum API function
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00185563
Message ID:
00185825
Views:
56
>Hi folks!
>
>I am trying to enumerate all network resources by using the WNetOpenEnum API call. I have read through all the MSDN documentation for this function, however when I call the function, I always have a return value of 87 which according to WNetGetLastError means that the "Parameter is incorrect". In my case, the fourth parameter NETRESOURCE is NULL which it is allowed.
>
>I would appreciate any suggestions:
>
>#DEFINE RESOURCE_CONNECTED 1
>#DEFINE RESOURCE_GLOBALNET 2
>#DEFINE RESOURCE_REMEMBERED 3
>#DEFINE RESOURCE_RECENT 4
>#DEFINE RESOURCE_CONTEXT 5
>
>#DEFINE RESOURCETYPE_ANY 0
>#DEFINE RESOURCETYPE_DISK 1
>#DEFINE RESOURCETYPE_PRINT 2
>#DEFINE RESOURCETYPE_RESERVED 8
>
>m.lnEnumHandle = 0
>
>DECLARE INTEGER WNetOpenEnum IN MPR.DLL ;
> INTEGER @nScope,;
> INTEGER @nType,;
> INTEGER @nUsage,;
> STRING @cNetResouce,;
> INTEGER @nHandle
>
>m.lnError = WNetOpenEnum( ;
> RESOURCE_GLOBALNET,;
> RESOURCETYPE_ANY,;
> 0,;
> NULL,;
> @lnEnumHandle )
>
>IF m.lnError == 0 && Successfull
> ...
>ENDIF
>
>
>Thanks in advance

Take a look at message 185193 for some hints.
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