Problem when looping through objects
Hi,
I have that code in a DLL to loop through controls
and doing some processes :
of TrfxReport :
and the report is loaded in a button (button1) :
The first time the preview is good and when
i close the preview window and load it again
i get an ""access violation at adress ......... in
filename.dll "" and the page is blank i tried to
debug the procedure and it seems that it is
called more than one time and it stop at the line :
TfrxMemoView?©.DisplayFormat.FormatStr
If someone has an idea ?
Thanks in advance
I have that code in a DLL to loop through controls
and doing some processes :
Procedure SetFormatReport (Report:TfrxReport);
var
  l: TList;
  i: Integer;
  c: TfrxComponent;
  FormatQuantity,FormatCurrency:String;
begin
FormatQuantity:='%2.'+IntToStr(DecimalCurrency)+'n';
FormatCurrency:='%2.'+IntToStr(DecimalQuantity)+'n';
  l := Report.AllObjects;
  for i := 0 to l.Count - 1 do
  begin
    c := l[i];
    if c is TfrxMemoView then
    if TfrxMemoView?©.TagStr='CURRENCY'  Then
      TfrxMemoView?©.DisplayFormat.FormatStr:=FormatCurrency;
    if TfrxMemoView?©.TagStr='QUANTITY'  Then
      TfrxMemoView?©.DisplayFormat.FormatStr:=FormatQuantity;
  end;
End;
The procedure is called from the OnBeforePrint eventof TrfxReport :
SetFormatReport (frxReport1);
and the report is loaded in a button (button1) :
frxReport1.ShowReport();
The first time the preview is good and when
i close the preview window and load it again
i get an ""access violation at adress ......... in
filename.dll "" and the page is blank i tried to
debug the procedure and it seems that it is
called more than one time and it stop at the line :
TfrxMemoView?©.DisplayFormat.FormatStr
If someone has an idea ?
Thanks in advance