Delphi 的RTTI机制浅探(续)
http://www.delphibbs.com/delphibbs/dispq.asp?LID=2421470
本文是《Delphi 的RTTI机制浅探》的续篇,上篇地址在:
http://www.delphibbs.com/delphibbs/dispq.asp?lid=2420610
本文上篇基本上是
RTTI 入门介绍,续篇介绍了所有 TypInfo.pas 中的函数,附加了 Classes.pas、Graphics.pas、Controls.pas
中的几个 RTTI 相关函数。对于关键函数的代码提供汇编注释。希望本文覆盖了 Delphi 中 80% 的 RTTI
函数。时间仓促,错误难免,敬请批评指正。
本文排版格式为:
正文由窗口自动换行;所有代码以 80
字符为边界;中英文字符以空格符分隔。
(作者保留对本文的所有权利,未经作者同意请勿在在任何公共媒体转载。)
目
录
===============================================================================
⊙
GetTypeData 函数
⊙ GetPropInfo 函数
⊙ FindPropInfo 函数
⊙ GetPropInfos
函数
⊙ SortPropList 函数
⊙ GetPropList
函数
------------------------------------------------------
⊙
GetObjectPropClass 函数
⊙ PropType / PropIsType 函数
⊙ IsPublishedProp 函数
⊙
IsStoredProp 函数
⊙ FreeAndNilProperties 函数
⊙ SetToString / StringToSet
函数
⊙ GetEnumName / GetEnumValue / GetEnumNameValue
函数
------------------------------------------------------
⊙ GetOrdProp
函数详解
⊙ SetOrdProp 函数
⊙ GetEnumProp / SetEnumProp 函数
⊙ GetSetProp /
SetSetProp 函数
⊙ GetObjectProp / SetObjectProp 函数
⊙ GetStrProp / SetStrProp
函数
⊙ GetFloatProp / SetFloatProp 函数
⊙ GetPropValue / SetPropValue 函数
⊙
TPublishableVariantType
class
------------------------------------------------------
⊙
RegisterClass / FindClass 系列函数 (Classes.pas)
⊙ IdentToInt / IntToIdent 系列函数
(Classes.pas)
===============================================================================
正
文
===============================================================================
⊙
GetTypeData
函数
===============================================================================
GetTypeData
函数根据 TTypeInfo 指针获得 TTypeData 的地址。
function GetTypeD
相关文档:
unit Servicescontrol;
interface
uses Windows,Messages,SysUtils,Winsvc,Dialogs;
function StartServices(Const SvrName:String):Boolean;
function StopServices(Const SvrName:String):Boolean;
function QueryServiceStatu(Const SvrName:  ......
procedure TForm_BaseMDI.FormKeyPress(Sender: TObject; var Key: Char);
begin
if Key = #13 then
begin
Key := #0;
SendMessage(Handle, 48384, 9, 0);
end;
end; ......
function GetFileSizeString(const pFileName: String):String;
var
iFileSize: Int64;
begin
Result := '0';
iFileSize := FileSizeByName(pFileName);
Result := IntToStr(iFileSize);
end;
function WinExecAndWait(strFileName: string; uCmdShow: UINT): DWORD;
var
cAppName: array ......
关于IntraWeb程序在编译时出现错误的解决方法
错误提示:[Error] IWLicenseKey.pas(12): Undeclared identifier: 'SetLicenseKey'
处理方法:进入菜单Tools->Environment Options,选择‘Library’,将'Library path'参数中有关intraweb的目录放在前面即可。
使用&n ......
program PureAPIWindow;
uses
SysUtils,
Windows,
Messages;
const
WinClassName = 'DvsClass';
StrOut = 'Davis TextOut';
//窗口回调函数
function MyWinProc(
hWindow: HWND;
aMessage: UINT;
WParam: WPARAM;
LParam: LPARAM): LRESULT; stdcall; export;
......