PrintPreview Access Violation

General TRichView support forum. Please post your questions here
Post Reply
jhonalone
Posts: 31
Joined: Mon Apr 07, 2008 5:59 pm
Location: Madrid

PrintPreview Access Violation

Post 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]
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
jhonalone
Posts: 31
Joined: Mon Apr 07, 2008 5:59 pm
Location: Madrid

Post by jhonalone »

YOU ARE COMPLETELY RIGHT SERGEY!!!

THIS WAS THE CAUSE OF THE ERROR.

THANK YOU VERY, VERY MUCH!!!
Post Reply