dll什么时候用呢|?(100分)

  • 主题发起人 主题发起人 维生素c
  • 开始时间 开始时间

维生素c

Unregistered / Unconfirmed
GUEST, unregistred user!
dll是动态连接库吧。。。可是有什么用?什么时候用呢?可是给一个简单的便于理解的例子吗?是不是像vb中的model一样?我可以把一个函数装在里面,然后把dll引入,然后就能使用函数了,是这个意思了吗|?
 
是啊,就是装了很多函数的单元,里面还可以放图片什么的,
 
大概是这个意思。我马上找一个简单的例子给你看看
 
除非要在多个工程中使用,或者希望动态加载,或者写一些特殊的东东,否则可以不用
 
library six;

{ 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;

{$R *.res}
function sixteen(s:string):integer;stdcall;
var
n,k,kk,kkk,i,m,zong,add,zh:integer;
shu:string;
begin
n:=length(s);
kkk:=n;
k:=n;
add:=0;
zong:=1;
for i:=1 to n do
begin
shu:=copy(s,k,k);
delete(s,k,k);
kk:=kkk-n;
for m:=0 to kk-1 do
begin
zong:=zong*16;
end;
if (shu='a')or(shu='A') then
begin
shu:='10';
end

else
if (shu='b')or(shu='B') then
begin
shu:='11';
end

else
if (shu='c')or(shu='C') then
begin
shu:='12';
end

else
if (shu='d')or(shu='D') then
begin
shu:='13';
end

else
if (shu='e')or(shu='E') then
begin
shu:='14';
end
else
if (shu='f')or(shu='F') then
begin
shu:='15';
end;
zh:=strtoint(shu);
add:=add+zh*zong;
k:=k-1;
kkk:=kkk+1;
end;
sixteen:=add;
end;
exports
sixteen;
begin
end.
 
谢谢宋菲了啊。。。
不过可不可以给点中文翻译???
 
后退
顶部