Y
yuanzichuan
Unregistered / Unconfirmed
GUEST, unregistred user!
DLL中:
TDllReportInfo = record
RepName: PChar;
TypeID: PChar;
FunName: PChar;
FrfName: PChar;
LoadType: PChar;
Describe: PChar;
end;
PRepInfo = ^TRepInfo;
TRepInfo=array of TDllReportInfo;
procedure FoldRepInfo(RepInfo: PRepInfo);stdcall;
begin
SetLength(RepInfo^,1);
RepInfo^[0].RepName:='每日结算报表';
RepInfo^[0].TypeID:='01';
RepInfo^[0].FunName:='NewJiesRpt';
RepInfo^[0].FrfName:='每日结算报表.frf';
RepInfo^[0].LoadType:='0';
RepInfo^[0].Describe:='';
end;
主程序中:
。。。
TFoldRepInfo = procedure(RepInfo: PRepInfo);stdcall;
。。。
FoldRepInfo := TFoldRepInfo(FPointer);
FoldRepInfo(@RepInfo1);
我的目的是在DLL中给我主程序中的数组增加数据(也就是我把数组的指针传到了DLL中),
为什么会出现指针错误呢?哪位高手能指教,不盛感激!
TDllReportInfo = record
RepName: PChar;
TypeID: PChar;
FunName: PChar;
FrfName: PChar;
LoadType: PChar;
Describe: PChar;
end;
PRepInfo = ^TRepInfo;
TRepInfo=array of TDllReportInfo;
procedure FoldRepInfo(RepInfo: PRepInfo);stdcall;
begin
SetLength(RepInfo^,1);
RepInfo^[0].RepName:='每日结算报表';
RepInfo^[0].TypeID:='01';
RepInfo^[0].FunName:='NewJiesRpt';
RepInfo^[0].FrfName:='每日结算报表.frf';
RepInfo^[0].LoadType:='0';
RepInfo^[0].Describe:='';
end;
主程序中:
。。。
TFoldRepInfo = procedure(RepInfo: PRepInfo);stdcall;
。。。
FoldRepInfo := TFoldRepInfo(FPointer);
FoldRepInfo(@RepInfo1);
我的目的是在DLL中给我主程序中的数组增加数据(也就是我把数组的指针传到了DLL中),
为什么会出现指针错误呢?哪位高手能指教,不盛感激!