请问我想用DELPHI来开发DLL文件。(不是高手别进来)(200分)

  • 主题发起人 waitingu
  • 开始时间
W

waitingu

Unregistered / Unconfirmed
GUEST, unregistred user!
我想用DELPHI来开发DLL文件。请问DELPHI可以做的好吗?
另外用DELPHI可以开发的到程序来访问IBM的AS400吗
 
delphi当然可以开发dll文件,如果你没试过,可以向我索取代码
fastersoft@peoplemail.com.cn
 
可以的,也很简单,封装函数与过程
 
DLL能做,但DLL下的表不能融合到主程序的DOCK上,不知道为什么[?]
 
用delphi做DLL当然可以,但我不是高手啊,下面是我的代码:
 
不是很难啊:
new->new wizard
dll文件代码:
library mydll;
{ 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;
procedure yourproc(参数);//与平常的一样
begin
end;
Exports
yourproc;
begin
end.
动态调用:
unit main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

type
Tyourproc=procedure(filename,key:pchar);
stdcall;
//定义一个Tyourproc函数类.此处的stdcall参数不可少
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var // 动态调用
myproc:Tyourproc;
handle:Thandle;
begin
try
handle:=Loadlibrary('mydll.dll');
//加载trans_dll.dll
if handle<>0 then
begin
@myproc:=GetProcAddress(handle,'yourproc');
//找到trans_filename函数的入口地址
if @myproc<>nil then
begin
myproc(参数);
end;
end;
freeLibrary(handle);
//释放trans_dll.dll,一定要!
except
showmessage('ERROR!');
end;
end;

end.
DLL虽简单,却很麻烦!
有问题:major520@21cn.com
 
delphi当然可以做dll,连这个都不能还能叫delphi?[8D]
不过我再写的时候遇到了一个问题,那就是,无论如何,pb无法调用我的动态链接。
那位知道如何让pb使用delphi写得dll?pb可以调用vc++用farpascal表示的方法。
 
谁能给我发一个DLL的原代码
eastrise@163.net
 
用Delphi写DLL是很简单的一件事,你搜索一下大富翁,多得很。
 
不是高手别进来->傻B都會
 
顶部