求救,我在dll里封装了fastreport,有错误

lanfanshen6884 2016-11-08 05:51:38
求救
这是我封装在dll里的一个过程,
procedure judgementDate(option: string; Count: integer);
begin
//当前pc时间比当ini时间要大,那么count需要从1累计
DT_Readini();
if P_DT_Readini<StrToDate(FormatDateTime('yy/mm/dd',now)) then
begin
P_count:=1;
DT_writeini();
PCount_Writeini();
//同一天时间内Count数值继续累计
end else if P_DT_Readini=StrToDate(FormatDateTime('yy/mm/dd',date)) then
begin
PCount_readini();
P_count:=P_count_ini+1;
PCount_Writeini();
end else begin
Application.MessageBox('系统时间错误,请调整'+#13+'', '提示',MB_ICONERROR+MB_ok);
end;
TfrxMemoView(frxReport.FindObject('Memo1')).memo.text:= IntToStr(Count);
TfrxMemoView(frxReport.FindObject('Memo2')).memo.text:= option;
frxReport.ShowReport();
end;


问题出在了
TfrxMemoView(frxReport.FindObject('Memo1')).memo.text:= IntToStr(Count);
TfrxMemoView(frxReport.FindObject('Memo2')).memo.text:= option;
frxReport.ShowReport();


错误:
Access violation at address 008D8120 in module 'Gettime.dll'. Read of address 00000000.


跟踪到报表的frxclass文件
function TfrxComponent.FindObject(const AName: String): TfrxComponent;
var
i: Integer;
l: TList;
begin
Result := nil;
l := AllObjects;
for i := 0 to l.Count - 1 do
if CompareText(AName, TfrxComponent(l[i]).Name) = 0 then
begin
Result := l[i];
break;
end;
end;


直接跳出循环了,我才知道,dll里根本就没有组件对象,我该咋办呢?


...全文
351 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
lanfanshen6884 2016-11-08
  • 打赏
  • 举报
回复
忘记说明了,我用的是D7

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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