>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.