以上函数写在exe文件中然后再调用,可以实现效果
然后写在Dll中,再调用则失效
何解?procedure SetDataGridFootType(DataGrid: TDBGridEh;
FFieldName: PChar; FType: TFooterValueType);
begin
with DataGrid do
begin
FooterRowCount:=1;
if not SumList.Active then SumList.Active:=true;
if FindColumn(FFieldName)<>nil then
FieldColumns[FFieldName].Footer.ValueType:=fvtSum;
end;
end;
然后写在Dll中,再调用则失效
何解?procedure SetDataGridFootType(DataGrid: TDBGridEh;
FFieldName: PChar; FType: TFooterValueType);
begin
with DataGrid do
begin
FooterRowCount:=1;
if not SumList.Active then SumList.Active:=true;
if FindColumn(FFieldName)<>nil then
FieldColumns[FFieldName].Footer.ValueType:=fvtSum;
end;
end;
你在调用该函数的文件首+ uses Activex;试试
然后写在Dll中,再调用则失效
何解?很明显,你在dll中的声明不对,或者调用方式有问题
我在DLL中的声明是这样的:
procedure SetAColValueType(DataGrid: TDBGridEh; ColName: PChar; FooterValueType: TFooterValueType); stdcall; //设置指dbgrid指定列footer类型然后在exe中声明如下:
procedure SetAColValueType(DataGrid: TDBGridEh; ColName: PChar; FooterValueType: TFooterValueType); stdcall; External 'PIniFiles.dll'; //设置指dbgrid指定列footer类型
就直接调用?请问大大哥们,我这样写法哪里错了?