library holyway;{ Important note about DLL memory management: ShareMem must be the first unit in your library's USES clause AND your project's (select Project-View Source) USES clause if your DLL exports any procedures or functions that pass strings as parameters or function results. This applies to all strings passed to and from your DLL--even those that are nested in records and classes. ShareMem is the interface unit to the BORLNDMM.DLL shared memory manager, which must be deployed along with your DLL. To avoid using BORLNDMM.DLL, pass string information using PChar or ShortString parameters. }uses SysUtils, Classes, GetMac in 'GetMac.pas', MD5 in 'MD5.pas';{$R *.res}{32位MD5} function MD5_32(s:PChar) : PChar;stdcall; begin Result := PChar(MD5Print(MD5String(StrPas(s))));end;{得到本机网卡地址} function GetAdd(): PChar;stdcall; begin Result := PChar(GetmacAdd); end;{得到服务器网卡地址} function GetAddress(AServerName: PChar): PChar;stdcall; var s :string; begin s := GetMacAddress(StrPas(AServerName)); Result := PChar(GetMacAddress(StrPas(AServerName))); end;exports MD5_32, GetAdd, GetAddress; begin end.
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }uses
SysUtils,
Classes,
GetMac in 'GetMac.pas',
MD5 in 'MD5.pas';{$R *.res}{32位MD5}
function MD5_32(s:PChar) : PChar;stdcall;
begin
Result := PChar(MD5Print(MD5String(StrPas(s))));end;{得到本机网卡地址}
function GetAdd(): PChar;stdcall;
begin
Result := PChar(GetmacAdd);
end;{得到服务器网卡地址}
function GetAddress(AServerName: PChar): PChar;stdcall;
var s :string;
begin
s := GetMacAddress(StrPas(AServerName));
Result := PChar(GetMacAddress(StrPas(AServerName)));
end;exports
MD5_32,
GetAdd,
GetAddress;
begin
end.