2011年11月30日

查找文件

摘要: 1 procedure TForm2.FindFile(APath: string; Filter: string; Rev: TStrings; 2 SubDir: Boolean); 3 var 4 R: Integer; 5 F: TSearchRec; 6 begin 7 if APath[Length(APath)] <> '\' then 8 APath := APath + '\'; 9 R := FindFirst(APath + '*.*', faAnyFile, F);10 while R = 0 do11 beg 阅读全文

posted @ 2011-11-30 14:40 easy33 阅读(339) 评论(3) 推荐(0) 编辑

2011年11月29日

Delphi操作xml

摘要: Delphi7 支持对XML文档的操作,可以通过TXMLDocument类来实现对XML文档的读写。可以利用TXMLDocument把XML文档读到内存中,从而可以进行编辑、保存操作。TXMLDocument类是通过DOM(文档对象模型)接口来访问XML文档中的各个元素的。对于DOM接口的实现有多种方式,Delphi支持的方式有:1)微软的MSXML SDK,这种方式是通过COM对象来实现;2) ... 阅读全文

posted @ 2011-11-29 14:36 easy33 阅读(445) 评论(2) 推荐(0) 编辑

2011年11月28日

淺談怎么样运用Delphi 2009地泛型容器類別

摘要: Delphi 2009在Delphi程式語言方面加入了兩個主要的功能,一個是泛型程式設計(Generics Programming),另外一個就是匿名方法(Anonymous Method)。Delphi 2009在Win32加入了泛型程式設計之後,Delphi程式語言便可以同時在Win32,.NET平台下使用泛型程式設計。由於Delphi 2009在Delphi程式語言本身加入了泛型程式設計,因... 阅读全文

posted @ 2011-11-28 15:41 easy33 阅读(242) 评论(0) 推荐(0) 编辑

Delphi随记

摘要: 可以用GetPropInfo来判断一个对象或者类是否拥有某个属性 可以用SetPropValue来为某个属性赋值,用GetPropValue来获取某个属性的值. 以上前提是属性必须声明在published里(在被判断类的前面使用{$M+},否则编译会出警告,但不影响功能),在public里是不行的. 当TObjectList对象的OwnsObjects属性设置为True(默认值)时,如果调用TO... 阅读全文

posted @ 2011-11-28 15:36 easy33 阅读(458) 评论(0) 推荐(0) 编辑

新的published和$M+对比

摘要: 新的published和$M+对比新的编译器警告“W1055 PUBLISHED caused RTTI ($M+) to be added to type '%s'”非常有趣。它解决了我们之前讨论过的一个问题。在以前的编译器版本中,如果你编写这样的代码:type TMyClass = class private FName: string; published property Name: st... 阅读全文

posted @ 2011-11-28 14:46 easy33 阅读(501) 评论(0) 推荐(0) 编辑

2011年11月15日

Delphi图像编程学习笔记

摘要: TGraphic是一个抽象类,TBitMap,TMetaFile,TICon等是它的子类。 TPicture是TGraphic的容器,可以显示或引用TGraphic的子类。 使用层次:TImage包含TPicture包含TGraphic(TBitMap,TMetaFile,TICon等)。 TBitMap,TMetaFile,TICon等包含有Canvas,但TGraphic不包含Canvas。 ... 阅读全文

posted @ 2011-11-15 14:52 easy33 阅读(624) 评论(0) 推荐(0) 编辑

插入窗体到别的程序里

摘要: Form1代码unit Unit1;interfaceuses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;type TForm1 = cla... 阅读全文

posted @ 2011-11-15 11:44 easy33 阅读(167) 评论(0) 推荐(0) 编辑

导航