Active control 向导生成的StringGrid Control出错

findingit 2005-06-26 01:19:35
使用ActiveX Control Wizard向导,在VCL Class Name:选择了TSTringGrid[Grids]
然后点击OK生成的工程居然编译不能通过
编译时出现如下错误:
[C++ Error] StringGridImpl1.cpp(1107): E2034 Cannot convert 'TOLEBOOL *' to 'short *'
[C++ Error] StringGridImpl1.cpp(1107): E2342 Type mismatch in parameter 'CanSelect' (wanted 'short *', got 'TOLEBOOL *')

出错的地方是StringGridImpl1.cpp,代码如下(都是向导自动生成):

void __fastcall TStringGridXImpl::SelectCellEvent(TObject *Sender,
int ACol, int ARow, bool &CanSelect)
{
TOLEBOOL TempCanSelect;
TempCanSelect = (TOLEBOOL)CanSelect;
Fire_OnSelectCell((long)ACol, (long)ARow, &TempCanSelect);
CanSelect = (TOLEBOOL)TempCanSelect;
}

大家可以自己试一试,有没有什么好的解决办法呢?
我试过了改为
void __fastcall TStringGridXImpl::SelectCellEvent(TObject *Sender,
int ACol, int ARow, bool &CanSelect)
{
short TempCanSelect;
TempCanSelect = (short)CanSelect;
Fire_OnSelectCell((long)ACol, (long)ARow, &TempCanSelect);
CanSelect = (TOLEBOOL)TempCanSelect;
}
编译通过可是在使用的时候就有问题了,
当options 设置为goEditing后就有问题了说明上面的修改还是不行
导致内存出错。
...全文
48 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
findingit 2005-06-26
  • 打赏
  • 举报
回复
大家看看有没有好的解决办法啊

703

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder ActiveX/COM/DCOM
社区管理员
  • ActiveX/COM/DCOM社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧