DLL工程
library SMs2000;
uses
SysUtils,
Classes,
SMSUnit;
{$R *.res}
exports
sms_GetVer,
begin
end.
引用单元
unit SMSUnit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, MyDelphi;
function sms_GetVer: word; stdcall;
implementation
function sms_GetVer: word;
begin
Result := $403;
end;
end.
定义单元
unit Sms2000;
interface
uses Windows, Messages;
function sms_GetVer: integer; stdcall;
implementation
function sms_GetVer;
external 'sms2000.DLL';
end.
调用方
unit Main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, SMS2000, MyDelphi;
————
就可以用了