How to refer to controls in a MDI form

I'm making an html editor with an mdi interface. I've added all the menus in the main form (is that ok?). So far so good.
However problems arised. I'm trying to make the File - Open menu work, but I don't know how to refer to the rich edit box located in the mdi form.

This is the code I'm using.
{Everything seems OK, but though this code doesn't compile because Child is TMDIChild and MainForm.ActiveMDIChild is TForm.}

Main form:

procedure TMainForm.mniArchivoAbrir(Sender: TObject);
var
  Child: TMDIChild;
begin
  Child := MainForm.ActiveMDIChild;
  SaveDialog.Filter := 'Archivos HTML (*.htm, *.html)|*.HTM;*.HTML';
  if SaveDialog.Execute then
    Child.Guardar(SaveDialog.FileName);

MDI form:

procedure TMDIChild.Guardar(Nombre: string);
begin
 reKeines.Lines.SaveToFile(Nombre);
end;


What can i do?

thanks.
pin_plunderAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rwilson032697Commented:
Try writing this line:

 Child := MainForm.ActiveMDIChild;

like this:

 Child := MainForm.ActiveMDIChild as TMDIChild;

I assume Guardar is a public method of TMDIChild?

Cheers,

Raymond.

 
0
rwilson032697Commented:
.. and yes, putting the menus in your main form is fine..

Cheers,

Raymond.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
pin_plunderAuthor Commented:
thanks a lot.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.