'Could not convert variant of type (Array Byte) into type (Integer)
来源:互联网 发布:二战法国投降 知乎 编辑:程序博客网 时间:2024/05/22 15:27
This is actually a report for ExpressQuantumGrid Suite (not ExpressEditors Library) but it is not obvious how to change the Product/Technology on the Edit Issue page after the ticket has already been created.
The following exception occurs in TcxGrid when trying to select multiple cells using the mouse using drag operations.
'Could not convert variant of type (Array Byte) into type (Integer)'
I attached a simpler project that includes all the necessary files for reproducing the error. It also includes a screenshot with the error message.
This error occurs in on line 8939 in cxCustomTableView.pas, in the method TcxCustomGridTableController.IsPullFocusingPosChanged. It only happens in grid mode, with cell multi-select enabled, when FPullFocusingRecordId is a byte array variant.
This might actually be a bug in the Delphi RTL that is not able to compare two byte array variants. I implemented the following simple workaround in cxCustomTableView.pas and this fixed the error:
function SameRecordID(V1, V2: Variant): Boolean;
var
I: Integer;
begin
if VarIsArray(V1) and VarIsArray(V2) then
begin
if (VarArrayLowBound(V1, 1) = VarArrayLowBound(V2, 1)) and (VarArrayHighBound(V1, 1) = VarArrayHighBound(V2, 1)) then
for I := VarArrayLowBound(V1, 1) to VarArrayHighBound(V1, 1) do
if V1[I] <> V2[I] then
begin
Result := False;
Exit;
end;
Result := True;
end
else
Result := V1 = V2;
end;
function TcxCustomGridTableController.IsPullFocusingPosChanged: Boolean;
begin
Result := not SameRecordID(FPullFocusingRecordId, DataController.GetRowId(FocusedRecordIndex)) or
(FPullFocusingItem <> FocusedItem);
end;
The error does not occur when DataModeController.GridMode is False, because in this case the two record IDs being compared are two integers.
I really hope you will be able to reproduce it this time. Please let me know if you need more information.
- 'Could not convert variant of type (Array Byte) into type (Integer)
- 解决 'Could not convert variant of type (NULL) into type (String)'
- RM6.5_XE5 异常 Could not convert variant of type(UnicodeString) into type(Double)
- 解决dev express quantumgrid v6.30使用中出现'Overflow while converting variant of type(Integer) into type(Date)'的错误
- could not create plugin of type
- Could not create task or type of type: junit
- Could not create task or type of type: junit. 错误
- Convert anonymous type into any type
- Looking for a four-byte integer type... Not found.
- VARIANT Type
- convert an int into a byte array
- Gradle编译出现Could not create plugin of type 'AppPlugin'
- Could not autowire. No beans of … type found
- Gradle出现Could not create task of type 'DependencyManagementReportTask'
- could not autowire.No beans of 'FunctionService' type found.
- 【问题】Could not autowire. No beans of … type found
- Could not autowire. No beans of 'xxxx' type found
- Could not autowire. No beans of 'xxxMapper' type found.
- [最短路] 3.2.6 Sweet Butter
- Math.Net入门笔记
- weblogic配置数据库连接池以及事务处理
- linux vi vim 配置 用于写c语言
- cnpack多国语言控件帮助
- 'Could not convert variant of type (Array Byte) into type (Integer)
- 排列组合
- cxGrid使用技巧
- FFmpeg的C++封装:FFmpegWrapper
- VerticalProgressBar 垂直进度条的实现
- Spring 五个事务隔离级别和七个事务传播行为和数据读取出现的四个问题(丢失或覆盖更新、脏读、非重复读、幻想读)
- 求一个字符串中连续出现次数最多的子串
- servlet笔记
- Linux CentOS5.5 的 IP设置