delphi dll 实例 与 dll窗体实例
delphi dll 实例 与 dll窗体实例
本动态链接库方法有
Min,Max,SynAPP,ShowForm,showmyform
dll工程文件
Library Project1;
uses
dllUnit1 in 'dllUnit1.pas' {Form1};
function Min(X, Y: Integer): Integer; export;
begin
if X < Y then Min := X else Min := Y;
end;
function Max(X, Y: Integer): Integer; export;
begin
if X > Y then Max := X else Max := Y;
end;
procedure showmyform();export;
begin
Form1 := TForm1.Create(nil);
Form1.ShowModal;
end;
exports
Min,Max,SynAPP,ShowForm,showmyform;
begin
end.
窗体单元文件:
unit dllUnit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
procedure SynAPP(App:THandle);stdcall;
procedure ShowForm;stdcall;
implementation
{$R *.dfm}
procedure SynAPP(App:THandle );stdcall;
begin
Application.Handle := App;
end;
procedure ShowForm;stdcall;
begin
Form1 := TForm1.Create (Application);
// Form2 := TForm2.Create(Application);
Form1.ShowModal;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
close;
end;
end.
相关文档:
unit
Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class
(TForm)
Button1: TButton;
Button2: TButton;
procedure
Button1Click(Sender: TObject);
procedure
Button2Click(Sender: TObj ......
JNI(Java+Native+Interface,Java本地接口)技术大家都不陌生,它可以帮助解决Java访问底层硬件的局限和执行效率的提高。关于JNI的开发,大多数资料讨论的都是如何用C/C++语言开发JNI,甚至于JDK也提供了一个javah工具来自动生成C语言程序框架。但是,对于广大的Delphi程序员来说,难道就不能用自己喜爱的Delphi与Java互通消 ......
专门针对delphi的,嵌入源码的病毒
如果在 X:\Program Files\Borland\Delphi7\Lib 发现有 SysConst.bak (12KB) 和
SysConst.dcu (18KB),那么恭喜你,中招了。
http://topic.csdn.net/u/20090817/20/102ba10b-82ae-472d-a0be-6d54ce6a331b.html
http://bbs.2ccc.com/topic.asp?topicid=330829
http://bbs.2ccc.com/top ......
Delphi字符串函数大全
uses StrUtils;
【字符串函数大全】
首部 function AnsiResemblesText(const AText, AOther: string): Boolean;
$[StrUtils.pas
功能 返回两个字符串是否相似
  ......
TreeView由节点构成,建树通过对TreeView.items属性进行操作。Items是一个TTreeNodes对象,这是一个TTreeNode集。
一、针对TTreeNodes,也就是 TreeView.Items,有这些属性:
1、count,节点个数。
2、item[index] ,通过index得到节点。
二、针对TTreeNodes,也就是 TreeView.Items,常用的添加节点的操作 ......