Delphi的BUGS之我见

 

下面是本人在Delphi实际的开发中发现的问题,希望能同大家一起交流。

 

1、TDateTimePicker的错误

TDateTimePicker控件在读写日期时有很多错误,主要是日期不能及时刷新。

随便举一个例子:

新建一个Form,然后添加一个TDateTimePicker控件,随便放一个浮动型按钮例如TSpeedButton或者TToolButton等,相信这种方式用的会很多!

在浮动按钮的Click事件中加入很简单的代码:

ShowMessage(FormatDateTime('yyyy-mm-dd',DateTimePicker1.Date));

此时你通过直接修改TDateTimePicker的时间值来修改日期,然后激活浮动按钮的Click事件,你会发现在TDateTimePicker中反映出来的日期并不是TDateTimePicker真实的日期!多试几次你会发现问题更严重!

相信Borland公司的人应该测出了此错误,但是没有修复!

现在似乎明白为什么没有日期型的DB控件!

 

2、TDBGrid的错误

如果你是通过TDBGrid直接读写数据,你会发现问题很致命!

随便举一个例子:

新建一个Form,然后添加一个TDBGrid,添加相应的数据关联然后激活数据源,随便放一个浮动型按钮,相信这种方式用的也比较多!

在浮动按钮的Click事件中加入很简单的代码:

ShowMessage(ADOQuery1.Fields.Fields[0].AsString);

然后运行!

运行时首先选中TDBGrid中的一条数据(已经默认选中一条),然后滚动鼠标的滚轮翻滚数据,就象大家平时上网是滚动浏览网页或者在Excel数据区滚动浏览一样,然后在TDBGrid中单击鼠标,你会发现此时在TDBGrid中实际控制了两条数据,继续则可能出现多条!

继续下去!

如果你不停的下翻直至TDBGrid中的光标在鼠标的游标之下然后点击,然后激活浮动按钮的Click事件,你会发现在TDBGrid中激活的数据与数据源中实际的当前数据根本就不一致!

在实际应用中相信会碰到这种情况:我明明选择是这条数据,但进行后继操作的为什么不是这条数据?

 

3、TQuickRep的错误

TQuickRep历来以使用简单,功能灵活(当然是通过添加代码来实现)而著名,当然她的缺陷之多也同样有名,这当然也不是完全Delphi的问题。

随便举一个例子:

系统主窗口是的FormStyle为fsMDIForm类型,系统中的各个窗体采用模式窗体(ShowModal),这是一个很普通的应用。

在实际中系统主窗口往往是最大化(WindowState = wsMaximized)的,如果在模式窗体中预览报表:

QuickRep1.Preview;

如果你把报表预览窗口最小化,你会发现你根本就不能关闭任何窗口!除非通过Alt+Ctrl+Delete强行关闭!

所幸QuSoft公司已经发现了这个问题,在专业版(目前是3.6.2版)解决方案居然是在预览窗口默认是普通窗口而不是标准版中的将窗体最大化!

 

4、IDE开发工具的问题

相信大家至少99%以上是直接通过Delphi提供的IDE工具进行开发,在实际应用中为了减少EXE文件的大小(主要是因为调用比较大的第三方控件引起的)往往会通过取消部分VCL连接库(例如非Delphi自身的*.BPL)来完成,现在发现在Delphi中几乎不可能要么全部添加,要么都不添加!

不管你在[Build with runtime packages]中如何设置都不管用,似乎IDE工具只辨认那个Check或者CFG文件中的那个[-LU]参数而不管其它!

说明:对此目前依然没有确认是IDE工具的问题或者其它问题,只是一般认为是IDE工具的问题。

 

 

 

Hank

starfarm@263.net

2002.12.12

阅读终点,创作起航,您可以撰写心得或摘录文章要点写篇博文。去创作
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
delphi2-delphi2010 全支持 dcu 装换 pas -------------------------------------------------------------------------------- Project Dcu2Pas Version 1.3 Purpose Decompile a D2-D7, K1-K3's dcu(dpu) file to Delphi source as origin as possible, without or with minimal modifications, then recompile to new one under other Delphi versions Author Nengwen Zhuo(卓能文) Homes http://soarowl.uhome.net, http://www.websamba.com/soarowl, http://soarowl.0catch.com Emails soarowl@yeah.net, soarowl@sina.com.cn Released 2003-02-10 Lastest home/dl/Dcu2Pas.rar(zip) FOR RESTORE YOUR LOST SOURCES AND OPTIMIZE YOUR CODES ONLY!!! -------------------------------------------------------------------------------- This project is in very early stage, no document yet. To see some features, reference my test cases file -- test.pas and the output file test.int, please. The output maybe more clear organised than source files!!! For further development, any suggestions and ideas are welcome. I have no time to update my homepages for a long time ;-) -------------------------------------------------------------------------------- Usage Run Dcu2pas, set properly options, select a desired dcu file double click to decompile it -------------------------------------------------------------------------------- Features - Supports the following type declarations and their typed consts: * Type redeclarations, for example: type MyTypeString = type String; * All integer types(Byte, Cardinal, Int64, Integer, Longint, Longword, Shortint, Smallint, Word) * All char types(AnsiChar, Char, WideChar) * All boolean types(Boolean, ByteBool, LongBool, WordBool) * Enumerated type, subrange of enumerated type and set of enumerated type For examples: type Size = (Small = 5, Medium = 10, Large = Small + Medium); TMySize = Medium..Large; type TEnumSet = set of (Club, Diamond, Heart, Spade); const vcSet4: TEnumSet = [Club,Spade]; * All real types(Comp, Currency, Double, Extended, Real, Real48, Single) * All string types(AnsiString, ShortString, String, String[XX], WideString) * Array type(with/without packed keyword), dynamic array and multidimensional dynamic array * Set type * Record type, with any variant parts in records. But if a record has any variant parts in it, the typed const may can't correctly decompile * Function/procedure type declaration - Support threadvar - Support resourcestring - Support class type, interface inheritation - Support object type - Support interface - Code decompiler to BASM, then a decpompiled file can recompile under other Delphi versions... - Code decompiler to Object-Pascal. I have some ideas, but I have no time, maybe in near future, I will code for it! -------------------------------------------------------------------------------- Update history Legend: - Bug fixed * Algorithm enhanced + New featuer added Ver2.0 Ver1.3 2003-02-10 * Code decompiler redesigned * Partly support D7 Ver1.2 2002-07-28 + Delete procedure, contructor, destructor frame 2002-07-18 + Procedure variable const + Now can distinguish: vc1: PChar ='test'; vc2: PChar = @vc1; 2002-05-28(Ver1.1) + Now correctly process interface properties and argument default values + Support resources, for example: {%R *.dfm}, {$R *.res} 2002-05-26 + Support default arguments + Support interface 2002-05-25 + Support object type + Support resourcestring + Support threadvar + Support function/procedure type 2002-05-24 + Support file type + Support set of enumerated type const decompiler + Support enumerated type const decompiler + Support subrange of enumerated type + Support dynamic array type - Array [enumerted type] of ... - Bugs in [packed] array fixed - Bugs in [packed] record fixed - Bugs in enumerated type fixed - Bugs in classify interface and implement declarations fixed
Version 1.7 build 929 (24.04.2014) * Fixed critical errors in the DCUDumper Version 1.6 build 911 (23.04.2014) * Added decopilation DCU for Delphi XE-X5 Version 1.5 build 888 (2012-07-24) * Fixed a critical errors in dumping of programs compiled in Delphi 2010,XE ?XE2 * Fixed minor bugs in the window "Select Process" Version 1.4 build 808 (2012-07-19) * Fixed a critical error in getting the process list in the "Select Process" window + Added detection of programs compiled with Delphi XE2 Version 1.3 build 777 (2012-07-18) * This version for test only + Partial support Delphi XE and Delphi XE2 + Fully supported DCU decompiling for Delphi XE and Delphi XE2 + Full refactoring the program interface - Removed languages support, now only English * Fixed many bugs in the "Select Process" window + Added debug privilege * Fixed other many bugs Version 1.1 build 211 (2010-03-26) * Fixed the definition of programs compiled in Delphi 7 + Added ability to drag files to the main window (drag & drop) Version 1.1 build 195 (2010-03-04) + Updated the DSF Editor * Fixed loss of DSF editor when parsing + In DSF editor adds support for Delphi 2007, 2009, 2010 (so far works only for parsing. Bpl) * Optimized code for rendering assembly code * Full reconstruction project to accelerate work on a batch of assemblies and the subsequent testing Version 1.1 build 191 + Updated the PE Editor + Improved the window "Options" + Added ability to change fonts: - In the DFM Editor - Lists ListView - In disassembler * Reduced the delay timer on the window screen saver Version 1.1 build 187 * Fixed a PE editor + Added saving of projects Delphi 2007 + Added saving of projects Delphi 2009 + Added saving of projects Delphi 2010 Version 1.1 build 180 + The project status has changed to "beta" Version 1.1 build 177 + Rewritten engine decompilation DCU + Rewrote the analysis engine EXE + New format DOI and DSF

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Hank

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值