Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems calling WNetOpenEnum API function
Message
From
09/02/1999 21:42:55
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00185563
Message ID:
00185793
Views:
66
The first 3 params must be passed by value and not by reference.

Vlad

>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform