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.
相关文档:
为了加快硬件的访问速度, 编译器通常要使用"数据对齐", 譬如:
//下面结构中: SizeOf(TRec) = 6; 因为 b 在这里也要占 2 字节.
TRec = record
a: Word;
b: Byte;
c: Word;
end
;
//下面结构中: SizeOf(TRec) = 16; 这里的 a 和 b 共占了 8 个字节.
TRec = record
a: Byte;
b: Byte;
c: Do ......
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 ......
研究了一下Pop3的邮件接收协议,然后随手写了一个Pop3的邮件接收控件!Pop3的邮件协议实际上是很简单的,知道那几个命令就行了,与服务器之间
的交互是一问一答得方式,控制起来也容易,相对而言邮件格式的解析倒是更加麻烦一点!于是也便顺带着将MIME邮件格式给熟悉了一下!总归说来,规律性比
较强,先获取最大的顶层框 ......
delphi 编写的com 对象 用php调用
的
实例
delphi:
function Tmyxml.Get_xml: WideString;
begin
Get_xml:='wo shi a lei!';
end;
function Tmyxml.Get_xmldata: WideString;
var
xmlStr:string;
begin
xmlStr := '<?xml version="1.0" & ......
type
TCharStack = class(TStack)
private
function GetTop: Char;
public
function Pop: Char;
function Push(Item: Char): Char;
property Top: Char read GetTop;
end;
const
FindSet = ['(',')'];
implementation
{$R *.dfm}
{ TCharStack }
......