大悟还俗

邮箱 key_ok@qq.com 我的收集 http://pan.baidu.com/share/home?uk=1177427271
  新随笔  :: 联系 :: 订阅 订阅  :: 管理

随笔分类 -  Delphi

摘要:分类运算符操作操作数结果类型范例算术运算符+加整数,实数整数,实数X + Y-减整数,实数整数,实数Result - 1*乘整数,实数整数,实数P * InterestRate/实数除整数,实数实数X / 2div整数除整数整数Total div UnitSizemod取模整数整数Y mod 6+(一元)符号等同整数,实数整数,实数+7-(一元)符号相反整数,实数整数,实数-X布尔运算符not否定布尔型Booleannot (C in MySet)and与布尔型BooleanDone and (Total > 0)or或布尔型BooleanA or Bxor异或布尔型BooleanA x 阅读全文

posted @ 2013-11-07 11:23 大悟还俗_2 阅读(189) 评论(0) 推荐(0)

摘要:指令参数存放位置参数传递顺序参数内存管理适用地点registerCPU寄存器从左到右被调用者默认,published 属性存取方法必须使用pascal栈从左到右被调用者向后兼容cdecl栈从右到左调用者调用 C++ 共享库stdcall栈从右到左被调用者API 调用safecall栈从右到左被调用者API 调用,如果回调函数;双接口方法必须使用其他指令near far export inline assemble 等,曾经在16下使用 阅读全文

posted @ 2013-11-07 11:22 大悟还俗_2 阅读(176) 评论(0) 推荐(0)

摘要:Delphi数据类型C/C++ShorInt8位有符号整数charByte8位无符号整数BYTE,unsigned shortSmallInt16位有符号整数shortWord16位无符号整数unsigned shortInteger,LongInt32位有符号整数int,longCardinal,LongWord/DWORD32位无符号整数unsigned longInt6464位有符号整数_int64Single4字节浮点数float*Real486字节浮点数 Doubles8字节浮点数double*Extended10字节浮点数long doubleCurrency64位货币类型 TDa 阅读全文

posted @ 2013-11-07 11:20 大悟还俗_2 阅读(185) 评论(0) 推荐(0)

摘要:出现runtime error临时解决办法,于注册表位置中找到如下键值HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Gdiplus,然后把键DisableTIFFCodec的值置为0..原微软提供的临时修复方法为关闭TIFF文件功能,此方法是重新打开漏洞影响的功能..错误信息形式为: Run-time error nnn at xxxx; 其中nnn是运行时的错误编号; xxxx是运行时的错误地址.编号说明I/O错误: (编号100-149)100磁盘读错误,若要对超过格式文件尾进行读取时101磁盘写错误,若磁盘满时,由CloseFile,Write,Writel 阅读全文

posted @ 2013-11-07 11:09 大悟还俗_2 阅读(1357) 评论(0) 推荐(0)

摘要:auxGetDevCaps API 获取附属设备容量auxGetNumDevs API 返回附属设备数量auxGetVolume API 获取当前卷设置auxOutMessage API 向输出设备发送消息auxSetVolume API 设置附属设备卷AbortDoc API 终止一项打印作业AbortPath API 终止或取消DC中的一切路径AbortPrinter API 删除打印机缓冲文件AbortSystemShutdown API 停止系统工作AccessCheck API 检验客户访问权限AccessCheckAndAuditAlarm API 检验访问,产生声音或警报Acti 阅读全文

posted @ 2013-11-07 10:41 大悟还俗_2 阅读(503) 评论(0) 推荐(0)

摘要:第一部分: 1. 设置ADOConnection的ConnectionString属性的OLE DB的提供者要选择Microsoft Jet 4.0 OLE DB Provider(这本来是用于连接Access数据库的驱动程序,但也可打开Excel文件),按 "下一步"按钮 2. 选择数据库名称。注意:Excel的扩展名是*.xls,而默认文件类型是Microsoft Access 数据库(*.mdb), 我们就选择"全部文件(*.*)"吧,接着选择我们要连接的Excel文件咯!!如果在当前路径,就直接填2007.xls。 这时先别慌按 "测试 阅读全文

posted @ 2013-11-01 10:38 大悟还俗_2 阅读(465) 评论(0) 推荐(0)

摘要:1. 首先需要设置程序生成 map 文件。Project -> Options -> Linker -> Map file , Detailed2. 计算公式Edit2.Text := IntToHex(StrToInt('$'+ Edit1.Text) - StrToInt('$00400000') - StrToInt('$00001000'), 8) ;将看到的地址错误,输入到 Edit1 中。3. 从 Map 文件中查这个地址。一般直接查是找不到的。根据获得的 Edit2 中的值。删掉最后 1 位,或者 2 位,查。得到 阅读全文

posted @ 2013-10-29 14:58 大悟还俗_2 阅读(1398) 评论(0) 推荐(0)

摘要:uses Winapi.GDIPAPI, Winapi.GDIPOBJ{, Winapi.GDIPUTIL};procedure TForm1.FormPaint(Sender: TObject);var graphics: TGPGraphics; pen: TGPPen;begin graphics := TGPGraphics.Create(Canvas.Handle); pen := TGPPen.Create(MakeColor(255,0,0)); graphics.DrawRectangle(pen, MakeRect(11, 22, 33, 44)); pen.Fr... 阅读全文

posted @ 2013-10-29 13:58 大悟还俗_2 阅读(216) 评论(0) 推荐(0)

摘要:******************************* * 编 译 错 误 信 息 * *******************************';' not allowed before 'ELSE' ElSE前不允许有“;”'' clause not allowed in OLE automation section 在OLE自动区段不允许“”子句'' is not a ty... 阅读全文

posted @ 2013-10-28 17:52 大悟还俗_2 阅读(845) 评论(0) 推荐(0)

摘要:以下代码旨在 脱离TXMLDocument 操作 xml。unit Unit3;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, xmldom, XMLIntf, msxmldom, XMLDoc, StdCtrls;type TForm3 = class(TForm) XMLDocument1: TXMLDocument; Button1: TButton; Button2: TButton; Button3: TBu... 阅读全文

posted @ 2013-10-21 16:56 大悟还俗_2 阅读(869) 评论(0) 推荐(0)

摘要:unit ExEdit; interface uses System.Classes, Vcl.Controls, Winapi.Windows, Vcl.Graphics, Vcl.StdCtrls, System.SysUtils, Winapi.messages; type TBorders = class(TPersistent) private FRight: Boolean; FBottom: Boolean; FTop: Boolean; FLeft: Boolean; FPen: TPen; public constructor ... 阅读全文

posted @ 2013-10-21 16:51 大悟还俗_2 阅读(305) 评论(0) 推荐(0)

摘要:先看看实现的效果如: 首先,我们来分析一下,这个控件的继承方式,这个根据个人需要,如果仅仅作为显示使用,不涉及到太多的消息以及事件响应消息的可以从TGraphicControl继承来实现,因为TGraphicControl就是专门用来实现仅仅显示效果的控件的,他的特性,我在前面的概述中有提到过,不明白的可以返回去查看;如果需要处理一些特殊消息以及句柄的处理的,那么请从TWinControl继承来实现。这里我选择直接从TGraphicControl来实现! 其次,这个动画效果,我们通过什么来实现!这个很容易想到TImagelist,Delphi自己带有的一组图片集合控件,通过这个图片集合,我们可 阅读全文

posted @ 2013-10-21 16:43 大悟还俗_2 阅读(290) 评论(0) 推荐(0)

摘要:第一步,平面效果。Windows系统有几个消息专门用来处理Windows组件的边框部位,那就是WM_NCCALCSIZE和WM_NCPAINT这两个消息,从消息名字看来NC这个就代表着No Client也就是非客户区域,NCCALCSIZE也就是说明了计算非客户区和客户区的消息,而WM_NCPAINT消息,也就是非客户区域的绘制触发消息,所以就要截获这两个消息来绘制自己的边框取代Windows系统的绘制方式。在Delphi中拦截系统消息非常简单,直接在消息的处理过程后面跟一个message关键字,然后加上消息常量就可以了!不像MFC要搞消息映射那么麻烦,声明代码如下procedure WMNc 阅读全文

posted @ 2013-10-21 16:41 大悟还俗_2 阅读(540) 评论(0) 推荐(0)

摘要:一.原理通过使用“内存映射文件”,实现内存共享二.主要操作共享内存结构: PShareMem = ^TShareMem; TShareMem = Record id:string[10]; name:string[20]; age:Integer; end; 基本变量: shareMemName:string; //共享内存名 fileHandle : THandle;//内存映射文件句柄 pUserInfoShareMem : PShareMem;//指向共享内存的指针 a)写入程序 1)创建“内存映射文件”begin //创建“内存映射文件”... 阅读全文

posted @ 2013-10-21 16:39 大悟还俗_2 阅读(462) 评论(0) 推荐(0)

摘要:unit filemap;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;const fileName = 'myTest.txt';type TForm1 = class(TForm) btnUpper: TButton; btnLower: TButton; txtContent: TMemo; Label1: TLabel; btnClose: TButton; procedu... 阅读全文

posted @ 2013-10-21 16:38 大悟还俗_2 阅读(1752) 评论(0) 推荐(0)

摘要:一.原理 通过使用“内存映射文件”,实现内存共享 二.主要操作 共享内存结构: PShareMem = ^TShareMem; TShareMem = Record id:string[10]; name:string[20]; age:Integer; end;// 一定要注意 固定长度 基本变量 阅读全文

posted @ 2013-10-21 16:33 大悟还俗_2 阅读(2185) 评论(0) 推荐(0)

摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Edit1: TEdit; procedure FormCreate(Sender: TObject); private { Private ... 阅读全文

posted @ 2013-10-21 14:34 大悟还俗_2 阅读(401) 评论(0) 推荐(0)

摘要:{== D6DLLSynchronizer =================================================}{: This unit handles the D6 synchronize problem in DLLs@author Dr. Peter Below@desc Version 1.0 created 3 November 2001 Current revision 1.0 Last modified 3 November 2001Usage: Just add this unit to the DLL... 阅读全文

posted @ 2013-10-21 14:32 大悟还俗_2 阅读(587) 评论(0) 推荐(0)

摘要:unit Unit1;interfaceuses ImageHlp,Windows,Dialogs; procedure ListDLLExports(const AFileName:string);implementationprocedure ListDLLExports(const AFileName:string);type TDWordArray = array [0..$FFFFF] of DWORD;var image:TLoadedImage; pExpDir:PImageExportDirectory; iSize:Cardinal; pNameRVAs:^TDW... 阅读全文

posted @ 2013-10-21 14:30 大悟还俗_2 阅读(220) 评论(0) 推荐(0)

摘要:// ① Delphi 使用 Interlocked 系列函数var MyValue:Longint = 0; // = Integerbegin InterlockedIncrement(MyValue); // + 1 返回值通常不用 InterlockedDecrement(MyValue); // - 1 返回值通常不用 InterlockedExchangeAdd(MyValue,10); // + 10 InterlockedExchangeAdd(PLongint(@MyValue),-10); // - 10 函数 overload InterlockedExcha... 阅读全文

posted @ 2013-10-21 14:27 大悟还俗_2 阅读(417) 评论(0) 推荐(0)