>I am trying to use the NETAPI NetServerEnum and I am not having any luck.
>Does anyone have any examples of how to use this API.
>
>Here is my code.
>
>DECLARE INTEGER NetServerEnum IN netapi32;
> INTEGER servername,;
> INTEGER level,;
> INTEGER @ bufptr,;
> INTEGER prefmaxlen,;
> INTEGER @ entriesread,;
> INTEGER @ totalentries,;
> INTEGER servertype,;
> STRING domain,;
> INTEGER resume_handle
>
>local prefMaxLen as integer,entriesRead as integer,totalentries as integer;
> ,ltype as integer,hresume as integer
>
>
> Level = 100
> PrefMaxLen = -1
> lType = 4
>
>
> Domain = "MYDOMAIN"+chr(0)
>
> L = NetServerEnum(0, ;
> Level, ;
> bufPtr, ;
> PrefMaxLen, ;
> EntriesRead, ;
> TotalEntries, ;
> lType, ;
> Domain, ;
> hResume)
>
>I get a return that is not 0 therefore I am not connecting.
>
>Any idea?
Well, first the bufptr parameter should be a string. Second, you might want to look at the late Ed Rauh's NETRESOURCE file in the download section. I know Ed had done a lot of stuff with the WNet family of API calls and I remember he did some work with enumerating networks. There may be an example in the download file.
George
Ubi caritas et amor, deus ibi est