Getting net users.Sending messages in a LAN

I'm using D1 and some code from BDE examples to get the users in a Lan
 Windows Network , Lantastic 6.0) through BDE calls ( BDE 252).

procedure GetNetUsers(AdStrings: TStrings);
var
  hCur: hDBICur;
  rslt: DBIResult;
  User: USERDesc;

begin
  Check(DbiOpenUserList(hCur));
  repeat
    rslt := DbiGetNextRecord(hCur, dbiNOLOCK, @User, nil);
    if rslt = DBIERR_NONE then
      AdStrings.Add(StrPas(User.szUserName))
    else
      if rslt <> DBIERR_EOF then
        Check(rslt);
  until rslt <> DBIERR_NONE;
end;

This code is crashing the computer in the DBI OpenUser list.

Does anybody know how to help me out? Is there any way to get the users
connected, either servers or clients in a LAN.
Is There a way to send them messages through the LAN using my database
program?

Adriano