L
lpzst002
Unregistered / Unconfirmed
GUEST, unregistred user!
我的代码如下,但里面有很多错误,请大家给我指点迷津
library Prodll;
uses
SysUtils,
Classes;
var
NetDogAddr: integer;
NetDogBytes: integer;
NetDogPassword: longint;
NetDogResult: longint;
NetDogData: ^byte;
NetDogHandle: ^longint;
doghandle: longint;
{$L nhdelphi.obj}
{$R *.res}
function NetDogLogin: longint; external;
function NetDogConvert: longint; external;
function NetDogRead: longint; external;
function NetDogLogout: longint; external;
Function DogLogin :Longint;stdcall;
var
I:Longint;
Begin
NetDogHandle := @doghandle;
NetDogPassword := 0;
I:=Netdoglogin();
Result:=0;
End;
Function DogLogOut:Longint;StdCall;
Begin
Result:=NetDogLogout;
End;
Function DogRead:longint;stdcall;
var
I,LongData:longint;
Begin
longData := 0;
NetDogData := @ longData;
NetDogBytes := 4;
NetDogAddr := 10;
Result:= NetDogRead();
End;
Function DogConvert(ConvertData:string):longint;stdcall;
var
dwRetCode:longint;
Begin
NetDogBytes := 6;
NetDogData := @ ConvertData[1];
dwRetCode := NetDogConvert();
Result:=NetDogResult;
End;
exports
DogLogin;
DogLogOut;
DogRead;
DogConvert;
begin
end.
obj的接口函数分别是
function NetDogLogin: longint; external;
function NetDogConvert: longint; external;
function NetDogRead: longint; external;
function NetDogLogout: longint; external;
但现在应该怎样将他们封装在dll里面呢,谢谢
NetDogAddr: integer;
NetDogBytes: integer;
NetDogPassword: longint;
NetDogResult: longint;
NetDogData: ^byte;
NetDogHandle: ^longint;
doghandle: longint;
这几个是obj里面的全程变量
library Prodll;
uses
SysUtils,
Classes;
var
NetDogAddr: integer;
NetDogBytes: integer;
NetDogPassword: longint;
NetDogResult: longint;
NetDogData: ^byte;
NetDogHandle: ^longint;
doghandle: longint;
{$L nhdelphi.obj}
{$R *.res}
function NetDogLogin: longint; external;
function NetDogConvert: longint; external;
function NetDogRead: longint; external;
function NetDogLogout: longint; external;
Function DogLogin :Longint;stdcall;
var
I:Longint;
Begin
NetDogHandle := @doghandle;
NetDogPassword := 0;
I:=Netdoglogin();
Result:=0;
End;
Function DogLogOut:Longint;StdCall;
Begin
Result:=NetDogLogout;
End;
Function DogRead:longint;stdcall;
var
I,LongData:longint;
Begin
longData := 0;
NetDogData := @ longData;
NetDogBytes := 4;
NetDogAddr := 10;
Result:= NetDogRead();
End;
Function DogConvert(ConvertData:string):longint;stdcall;
var
dwRetCode:longint;
Begin
NetDogBytes := 6;
NetDogData := @ ConvertData[1];
dwRetCode := NetDogConvert();
Result:=NetDogResult;
End;
exports
DogLogin;
DogLogOut;
DogRead;
DogConvert;
begin
end.
obj的接口函数分别是
function NetDogLogin: longint; external;
function NetDogConvert: longint; external;
function NetDogRead: longint; external;
function NetDogLogout: longint; external;
但现在应该怎样将他们封装在dll里面呢,谢谢
NetDogAddr: integer;
NetDogBytes: integer;
NetDogPassword: longint;
NetDogResult: longint;
NetDogData: ^byte;
NetDogHandle: ^longint;
doghandle: longint;
这几个是obj里面的全程变量