This is my code:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls;
...
implementation
{$R *.dfm}
uses Unit2;
...
procedure TForm1.Button4Click(Sender: TObject);
begin
Frame2.Show;
end;
I got this compiler error:
Undeclared identifier: ‘Frame2’
Then I tried to declare it:
Frame2: TFrame2;
Edit:
Further explenation form comment.
Ok I will be precise. I use anwser ardnew Frame2: TFrame; and I get ** access violation** and with out it I get Undeclared identifier: ‘Frame2’ now I’m more precise?
You did not show the contents of Unit2, so we can only speculate. It sounds like there is no
Frame2global variable declared in Unit2.pas. That would account for theundeclared identifiererror. Declare the variable yourself, and instantiate an instance of theTFrame2class before you can thenShow()it, eg: