摘要: 一个Delphi下Abstract Error问题的处理 分类: PASCAL应用(Delphi) 2011-07-18 09:49 434人阅读 评论(0) 收藏 举报 今天在修改一个公司项目的时候出现了Abstract Error问题,在网上查找之后发现为纯虚函数引起.但是看了代码之后,发现该类的子类的同名函数也实现了.这是什么原因呢?后来终于找了原因.T1 = Class(TObject) //这个我们假设是基类public function f1();virtual;abstract;T1s = Class(T1) //这个是我们用到的类的父类public function f1(); 阅读全文
posted @ 2012-02-08 16:09 马儿快跑 阅读(8205) 评论(0) 推荐(0) 编辑
摘要: Delphi 调用VC的DLLVC中DLL声名格式: Extern “C” void __declspec(dllexport) __stdcall ShowMess(HWND hwnd, char* mess);输出格式为:_ShowMess@8,“8”为函数参数字节数为了避免名称分裂,可采用以下方法解决:1.声明中不加__stdcall,采用VC默认格式__cdecl,但在Delphi中要注明调用格式为cdecl。2.在VC工程中添加def文件,如:LIBRARYEXPORTSShowMess @1则DLL中输出函数名称不分裂。Delphi中调用格式: Procedure ShowMess 阅读全文
posted @ 2012-01-05 23:17 马儿快跑 阅读(4115) 评论(0) 推荐(0) 编辑
摘要: [转载]用vc封装自己的dll(2010-11-17 19:17:24) 转载▼标签: 转载原文地址:用vc封装自己的dll作者:木木初学vc就要自己封装动态库,我是用c写的程序代码,在网上找了半天,发现vc++深入详解(孙鑫)的书不错,对于第十九章中的动态链接库,讲的很详细,学习了很多。我的动态链接库的制作,总结了一下,从小的简单的dll逐渐逐层放大,记录下来,以后方便查找。1.Win32 DLL的创建和使用首先利用vc++新建一个Win32Dynamic-Link Library 类的工程,工程取名为:Dll1,并在AppWizard的第一步选择“An empty Dll project” 阅读全文
posted @ 2012-01-05 16:22 马儿快跑 阅读(2520) 评论(0) 推荐(0) 编辑
摘要: Delphi与C语言类型转换对照2010-10-06 20:53:49|分类: 默认分类 |标签: |字号大中小订阅 When converting C function prototypes to Pascal equivalent declarations, it's important to substitute the C function and argument types with the correct Pascal types. I often use a Type Translation Table for this, like the following in t 阅读全文
posted @ 2012-01-03 21:14 马儿快跑 阅读(4210) 评论(0) 推荐(0) 编辑
摘要: 支持Delphi2009/2010的DES加密单元作者:garfieldtom来源:博客园发布时间:2009-11-12 15:27阅读:444 次原文链接 [收藏] 原来在D7/D2007下使用过一个DES的加密单元,但到了D2009/D2010后因为String被映射为unicodestring,不再是AnsiString,所以加密解密字符串失去了作用。经过修改,可以正确使用了,主要修改其中的string,显示指定为AnsiString,char,显示指定为AnsiChar.unit DESCrypt;interfaceusesSysUtils,Classes;typeTByte32 = 阅读全文
posted @ 2011-12-31 10:32 马儿快跑 阅读(2960) 评论(0) 推荐(2) 编辑
摘要: unit Des;interfaceuses SysUtils;type TKeyByte = array[0..5] of Byte; TDesMode = (dmEncry, dmDecry); function EncryStr(Str, Key: String): String; function DecryStr(Str, Key: String): String; function EncryStrHex(Str, Key: String): String; function DecryStrHex(StrHex, Key: String): String;const BitIP: 阅读全文
posted @ 2011-12-31 10:32 马儿快跑 阅读(387) 评论(0) 推荐(0) 编辑
摘要: PINGWindows supports an Internet Control Message Protocol (ICMP) to determine whether or not a particular host is available. ICMP is a network layer protocol that delivers flow control, error messages, routing, and other data between Internet hosts. ICMP is primarily used by application developers f 阅读全文
posted @ 2011-12-28 11:49 马儿快跑 阅读(475) 评论(0) 推荐(0) 编辑
摘要: 众所周知,Delphi ListView类直接进行Add、Update、Delete操作的速度是比较慢的,尤其是当数据量较大时,比如数据量达到5000、10000、50000时,速度真是可以说是“慢得惊人”。其实快速操作的方法非常简单,就当大家都知道了。在本人的工作中,很多项目都用到ListView,并且对速度的响应要求比较高,于是发生了快速操作ListView的代码散布于多个项目大量模块中的问题,并且,当界面层数据显示要求发生改变时,自然发生“重复性代码的通用问题”。考虑到对以前版本的兼容性问题,也一直没有引用第三方的成熟组件。鉴于:“程序中的重复代码最易引发问题,必须消除”的实践经验,自己 阅读全文
posted @ 2011-12-27 16:30 马儿快跑 阅读(4089) 评论(0) 推荐(0) 编辑
摘要: delphi中有直接把10进制转换成16进制的函数: function IntToHex(Value: Integer; Digits: Integer): string; overload; function IntToHex(Value: Int64; Digits: Integer): string; overload;使用方法为:procedure TForm1.Button1Click(Sender: TObject);var i,m: Integer;beginLabel1.Caption := '';for i := 1 to Le... 阅读全文
posted @ 2011-12-22 11:18 马儿快跑 阅读(22208) 评论(1) 推荐(0) 编辑
摘要: procedure TForm1.Button1Click(Sender: TObject); const s = 'abcd1234'; var arr: array of Byte; i: integer; s2: string; begin //string to byte array SetLength(arr,Length(s)); CopyMemory(arr,PChar(s),Length(s)); for i := 0 to High(arr) - 1 do ShowMessage(chr(arr[i])); //byte array to string Set 阅读全文
posted @ 2011-12-22 10:33 马儿快跑 阅读(4113) 评论(0) 推荐(0) 编辑