delphi_dll调用

时间:2014-02-08 08:51:20
【文件属性】:

文件名称:delphi_dll调用

文件大小:633KB

文件格式:RAR

更新时间:2014-02-08 08:51:20

dll调用

unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters, cxContainer, cxEdit, dxSkinsCore, dxSkinsDefaultPainters, Menus, StdCtrls, cxButtons, cxTextEdit; type TForm1 = class(TForm) cxTextEdit1: TcxTextEdit; cxButton1: TcxButton; procedure cxButton1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; TDelphiDllFunc = function(Aint:Integer):Integer;stdcall; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.cxButton1Click(Sender: TObject); var i:Integer; DllHandle:THandle; Func: TDelphiDllFunc; begin DllHandle:=LoadLibrary('project1.dll'); try @Func:=GetProcAddress(DllHandle,'DelphiDll'); if Assigned(@Func) then begin i:=Func(11); cxTextEdit1.Text := IntToStr(i); end; finally FreeLibrary(DLLHandle); end; end; end.


【文件预览】:
CallDll
----__history()
--------Unit1.pas.~1~(775B)
--------Unit1.pas.~2~(775B)
----Unit1.dcu(5KB)
----Project1.exe(1.24MB)
----Project1.dll(83KB)
----Unit1.dfm(637B)
----Project1.dpr(230B)
----Unit1.pas(1022B)
----Project1.identcache(213B)
----Project1.res(5KB)
----Project1.dproj(4KB)
----Project1.skincfg(85B)
----Project1.dproj.local(830B)
DelphiDll
----__history()
----Project1.dll(83KB)
----Project1.dpr(805B)
----Project1.identcache(112B)
----Project1.res(5KB)
----Project1.dproj(4KB)
----Project1.skincfg(85B)
----Project1.dproj.local(364B)

网友评论

  • 可以使用。。。谢谢
  • 很不错,可以调用!