about novell login
siclj 2000-01-06 02:47:00 下面这段程序在delphi1.0下编译通过,但在win32下运行结果错误,在win98 下结果
正确.改在delphi5.0下编译,运行时出错,说nwcall.dll已经损坏,调用错误.这是为什么?implementation
type
NWTimeStamp = record
Year: byte;
Month: byte;
Day: byte;
Hour: byte;
Minute: byte;
Second: byte;
DayOfWeek: byte;
end;
{Netware API's - require NWCALLS.DLL}
function NWGetConnectionInformation(Connection: word;
ConnectionNumber: word;
ObjectName: pchar;
var ObjectType: word;
var ObjectID: word;
var LoginTime: NWTimeStamp):word;
far; external 'h:\datadic\swaic\NWCALLS';
{ end of Netware API stuff }
function GetUserLogin: string;
var
ConnectionID: word;
ConnectionNumber: word;
RC: word;
Name: array[0..50] of Char;
ObjectType: word;
ObjectID: word;
LoginTime: NWTimeStamp;
begin
RC := NWGetConnectionInformation( ConnectionID,
ConnectionNumber,
Name,
ObjectType,
ObjectID,
LoginTime);
Result := StrPas(Name);
end;
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
showmessage(GetUserLogin);
end;