有关delphi7.0中的重大BUG ( 积分:100, 回复:34, 阅读:1068 )
分类:控件 - 使用 ( 版主:amo, cAkk )
来自:huyanqiong, 时间:2003-1-4 16:24:00, ID:1560052 [显示:小字体 | 大字体]
在DELPHI7.0中combobox的item选项中加入一个空值。在win98下如果选择空值的项目会出现
非法操作并中止程序。在win2000标准版下会报ntdll.dll出错。不知各位有没有出现这类
问题。所有的操作系统全部是重装的系统。delphi也没有安装任何第三方控件。
来自:qinmingzsj, 时间:2003-1-4 16:29:00, ID:1560064
我沒有呀!樓主!
来自:dhycq, 时间:2003-1-4 16:30:00, ID:1560066
NO,NO,NO,没有问题!这些我都试过了!
来自:journer, 时间:2003-1-4 16:31:00, ID:1560069
没有吧,可能是你程序的问题
来自:huyanqiong, 时间:2003-1-4 16:37:00, ID:1560086
我的系统全是新装的,没有装其它任何软件。且当编译过的程序到其它的机器上同样报错。
如果有兴趣的,我可以把程序发给你们试,上面就一个combobox一段代码都没有。
来自:lql0459, 时间:2003-1-4 16:39:00, ID:1560090
专门调试了一会,没有你出现的问题
来自:lanbing1400, 时间:2003-1-4 16:42:00, ID:1560095
那可能是你装的D7有问题了
来自:huyanqiong, 时间:2003-1-4 16:42:00, ID:1560096
会不会是我用的delphi7的版本有问题?请问那的delphi7下载好一点.
来自:menxin, 时间:2003-1-4 16:42:00, ID:1560098
我遇到过,访问就有问题
比如第三行是空
那么
ShowMessage(ComboBox1.Items[2]);
就会出错
来自:oiwin, 时间:2003-1-4 16:42:00, ID:1560100
我试过,没有这回事的,一定是你的D7的问题了.
来自:huyanqiong, 时间:2003-1-4 16:51:00, ID:1560136
menxin,你后来是怎么解决的。我已在公司的电脑上都试了,问题依旧呀
来自:menxin, 时间:2003-1-4 16:53:00, ID:1560145
无法解决
只能等UPDATE出来
不过我没有看源码,也许有解决的办法。有时间看一下吧
来自:huyanqiong, 时间:2003-1-4 16:58:00, ID:1560163
我现在的情况是根本不能在combobox的选项中加入空项。否则一选就挂,在win2000 server
和winxp上没这个问题。其它系统就不行了,真不知道是什么回事,今天系统不知重装了几次了
delphi也重装了n次,还换了n台机器,还是不行。[:(]
来自:menxin, 时间:2003-1-4 16:59:00, ID:1560167
SERVER没问题?我现在就在Advanced Server上,就有这个问题
来自:huyanqiong, 时间:2003-1-4 17:00:00, ID:1560168
是吗,你报什么错呀
来自:menxin, 时间:2003-1-4 17:01:00, ID:1560173
ntdll.dll
来自:huyanqiong, 时间:2003-1-4 17:04:00, ID:1560181
你可以选择空值的项目吗
来自:menxin, 时间:2003-1-4 17:06:00, ID:1560189
不能,任何访问都不能
来自:huyanqiong, 时间:2003-1-4 17:14:00, ID:1560210
请没有这类问题的朋友注意:
这个问题发生的过程是这样的。我一直在D7上做程序,都没出过错。编绎好后,在其它机
器上(98、2000标准版、2000server)上测试就出错了,98是非法操作。2000标准版是
NTDLL。DLL出错。我以为是我的环境有问题(win2000标准版SP3+SQL2000+D7),就全部重
装了。但重装后的结果是我在本机都有报错了,且在开发环境下都会报错。
来自:huyanqiong, 时间:2003-1-4 17:16:00, ID:1560217
另说明一下,排除病毒的可能性.
来自:menxin, 时间:2003-1-4 17:16:00, ID:1560219
呵呵,我搞定
下载这个PATCH就可以了,是由于windows2000 SP3
http://codecentral.borland.com/codecentral/ccweb.exe/listing?id=18872
Problem: Selecting an empty string in TComboBox component will cause Access Violation on some systems. See details in Quality Central report #2246.
Description: On some systems (Windows 2000 SP3) it will cause Access Violation in ntdll.dll because the code in TCustomComboBoxStrings.Get method passes nil to the API function call for an empty string item.
The patch fixes it for both standalone executables or applications compiled with runtime packages. To use it just add D7ComboBoxStringsGetPatch.pas unit to the project.
Note: It will not work if the application is compiled with Debug DCUs
来自:homejun, 时间:2003-1-4 17:24:00, ID:1560241
我发现delphi7导入activeX功能有问题,导入msagent2.0后,编程让精灵说话, 不管怎样
都不出声。同样的代码delphi5就正常
来自:huyanqiong, 时间:2003-1-4 17:26:00, ID:1560249
太好了.我试了一下DEMO没有报错了.这个补丁怎么用,我给分你
来自:menxin, 时间:2003-1-4 17:28:00, ID:1560256
这不是说得很清楚了吗
>>To use it just add D7ComboBoxStringsGetPatch.pas unit to the project
来自:menxin, 时间:2003-1-4 17:39:00, ID:1560285
改源码也可以
stdctrls.pas
function TCustomComboBoxStrings.Get(Index: Integer): string;
var
Len: Integer;
begin
Len := SendMessage(ComboBox.Handle, CB_GETLBTEXTLEN, Index, 0);
if (Len <> CB_ERR) and (Len <> 0) then //原来是if (Len <> CB_ERR) then
begin
SetLength(Result, Len);
SendMessage(ComboBox.Handle, CB_GETLBTEXT, Index, Longint(PChar(Result)));
end
else
SetLength(Result, 0);
end;