2个简单的关于dll调用的问题
现在有一dll不知道怎么调用。请高手列出静态和动态的调用方法。
library delphi;
{ 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,
Clipbrd,
DBGrids,
forms,
Classes;
{$R *.res}
function CopyDBGrid(DBGrid: TDBGrid):tdbgrid;
const
SEP = #9; //field之间的分隔
CRLF= #13#10;//回车换行
var
i,j : Integer;
s : String;
begin
For i := 0 to Dbgrid.Columns.Count-1 do
begin
if i > 0 then s := s + SEP;
s := s + dbgrid.Columns[i].FieldName;
end;
s := s + CRLF;
if DBGrid.SelectedRows.Count>0 then
begin
with DBGrid.DataSource.DataSet do
begin
for i:=0 to DBGrid.SelectedRows.Count-1 do
begin
GotoBookmark(pointer(DBGrid.SelectedRows.Items[i]));
for j := 0 to FieldCount-1 do
begin
if (j>0) then s:=s+SEP;
s:=s+Fields[j].AsString;
end;
s := s + CRLF;
end;
end;
end;
ClipBoard.SetTextBuf(pchar(s));
end;
Exports CopyDBGrid;
begin
end.