D1 TNotifyEvent

_________________________________________

I have a preview form in a current project which handles printing.
Everything works aok. The form accepts two callback properties so it can
access routines in the (various) units which call it.

All this works aok so long as the preview form is called by another form.

If I try to call the preview form from a unit, I get an error when
assigning the callbacks (other than that, everything still works). The code
segments are identical.

CALLING FORM DECLARATION:

  public
    procedure PrintOut(Sender: TObject);
    procedure GetPageLayout(Sender: TObject);
    procedure CreatePreview;

OR CALLING UNIT DECLARATION:

  procedure PrintOut(Sender: TObject);
  procedure GetPageLayout(Sender: TObject);
  procedure CreatePreview;

procedure frmCallingUnit.CreatePreview;
(* OR just procedure CreatePreview; *)
begin
  try
    frmPreview := TfrmPreview.Create(Application);
    with frmPreview
    do begin
      Orientation := poPortrait;
      Font := ReportFont;
      Colour := PrintColour;
      SetMargins(MM, sLeft, sTop, sRight, sBottom);
      OnPrintOut := PrintOut;
      OnSetup := GetPageLayout;
    end;
  except
  end;
end;

A simple error I suspect. But can you see it?
_________________________________________

  ?  Leigh Harrison      
  ?  tel +64 6 343 2671
  ?  fax +64 6 343 2649
  ?  mobile 025 933 913
  ?  email le...@radiOshop.co.nz
  ?  3 Iris Place Wanganui New Zealand
_________________________________________
                             radiOshop