Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get Domain Controller List Code Not Working
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00407805
Message ID:
00407840
Views:
22
>Mucking around with the API to enumerate all of the domain controllers in my area:
>
>
>declare integer NetGetAnyDCName in NETAPI32 ;
>  STRING @servername , STRING @domainname , DOUBLE bufptr
>  servername = .null.
>  domainname = .null.
>  bufptr = 400000
>  nRetVal = NetGetAnyDCName(@servername,@domainname,bufptr)
>  ? nRetVal
>
>
>All I get is
'-1073741819'
. Any thoughts?

Yep, it's misdeclared and mis-initialized. I'd suggest redeclaring it with all parameters as INTEGER. It expects to handle UniCode strings. You'll need to have something to handle the buffer returned as a NetAPIBuffer. You might want to look at the code in my NETRESOURCE class which uses the WNetEnumResource call. THe API call you're trying to implement only works on NT or 2K systems.
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