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;
...全文
219 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
siclj 2000-01-07
  • 打赏
  • 举报
回复
在delphi5.0下编译,运行时出错,说nwcall.dll已经损坏,调用错误.这应该是32位程序
调用16位dll出错,应该要一个转换程序,谁有这方面的例子吗?(lujun2000@shinwa.com.cn)
这段程序在delphi1.0下编译通过,但在win32下运行结果错误,在win98 下运行结果
正确.这又是为什么?
siclj 2000-01-07
  • 打赏
  • 举报
回复
thank you,I'll try!
kxy 2000-01-07
  • 打赏
  • 举报
回复
就在这个网站的Delphi开发文档就有相应的资料, 连接是:
http://www.midatech.com/csdn/Delphi/Document/thunk95.htm
祝你好运......
kxy 2000-01-06
  • 打赏
  • 举报
回复
procedure beVersion(var pbeVersion : TBEVersion); cdecl; external 'BLADEENC.DLL';

implementation 之前如上写
//这里不写
siclj 2000-01-06
  • 打赏
  • 举报
回复
[Error] UNIT1.PAS(37): Declaration of 'NWGetConnectionInformation' differs from previous declaration
kxy 2000-01-06
  • 打赏
  • 举报
回复
stdcall
siclj 2000-01-06
  • 打赏
  • 举报
回复
在delphi5 中我早已经把far 去掉了
kxy 2000-01-06
  • 打赏
  • 举报
回复
win32,win98下把far; external 'h:\datadic\swaic\NWCALLS';
改为 externl 'NWCALLS' ; stdcall;
注意,32位编程没有far 的概念,far只是向下兼容.
加入 stdcall;
不加绝对路径,会在window的搜索路径中查找nwcalls的dll,移植性好.

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧