易截截图软件、单文件、免安装、纯绿色、仅160KB

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.


相关文档:

《Delphi 算法与数据结构》: 关于 const

如果参数在函数中不可能修改, 一定要使用 const;
不然, 编译器就会:
假定先修改, 先要备份; 使用前后要增减引用计数; 还要套上 try finally.
指定了 const 就可以避免以上过程从而提高效率.
unit
Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs ......

Delphi 通过MSHTML实现一个HTML解析类

最近经常会模拟网页提交返回网页源码,然后获得网页中相应的元素,于是需要常常解析Html中相应的各种元素,网络是个好东西,搜索一番,就找到了
好几个Delphi版本的HtmlParser的类库,试着使用了几个,发现解析起来都不完整,或多或少的回出现一些问题!于是想到了如果界面上有一个浏
览器,我们可以通过WebBrowser的Docu ......

delphi开发ocx控件开发笔记(一)

      由于项目的需要,近期开始学习用delphi开发一个软电话控件。
      以前接触过一些delphi开发方面的东西(当然都是些皮毛啦),但没接触过ocx控件的开发,在此把一些简单的东西记下来,一方面以后自己可以再学习,另一方面希望对刚刚学习delphi开发ocx控件的初学 ......

《delphi学习园地》之 Treeview使用详解

TreeView由节点构成,建树通过对TreeView.items属性进行操作。Items是一个TTreeNodes对象,这是一个TTreeNode集。
一、针对TTreeNodes,也就是 TreeView.Items,有这些属性:
1、count,节点个数。
2、item[index]  ,通过index得到节点。
二、针对TTreeNodes,也就是 TreeView.Items,常用的添加节点的操作 ......

Delphi 关键字详解

Delphi 关键字详解---absolute//它使得你能够创建一个新变量, 并且该变量的起始地址与另一个变量相同.
var
Str: string[32];
StrLen: Byte absolute Str;
//这个声明指定了变量StrLen起始地址与Str相同.
//由于字符串的第0个位置保存了字符串的长度, 所以StrLen的值即字符串长度.
begin
Str := 'abc';
Edit ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号