Page 1 of 1

PrintPreview Access Violation

Posted: Sat Jan 15, 2011 12:00 pm
by jhonalone
I use an old version 1.9.48
Time ago, I developed a simple editor.
My PC cracked.
Now, I just reinstalled Delphi7.
When I try recomplile editor, I get an Access Violation error.
No changes made.

I do not understand!!!!

Can help me anyone, please?

Thanks.

Code: Select all


function TFormUnidad1.EditorActivo:TRichViewEdit;
begin
  Result:=PageControl1.ActivePage.Controls[0] as TRichViewEdit;
end;

procedure TFormUnidad1.PagPreviewClick(Sender: TObject);
begin
  RVPrint1.AssignSource(EditorActivo);
  RVPrint1.FormatPages(rvdoALL);
  if RVPrint1.PagesCount>0 then begin
    frmPreview.rvpp.RVPrint := RVPrint1; /////Access Violation at this line
    frmPreview.Button1Click(nil); 
    frmPreview.ShowModal;
  end;
end;
[/code]

Posted: Sat Jan 15, 2011 12:14 pm
by Sergey Tkachenko
Are you sure that frmPreview is created?
May be it was not added in the list of autocreated forms for this project.

Posted: Sat Jan 15, 2011 12:51 pm
by jhonalone
YOU ARE COMPLETELY RIGHT SERGEY!!!

THIS WAS THE CAUSE OF THE ERROR.

THANK YOU VERY, VERY MUCH!!!