一
一辉
Unregistered / Unconfirmed
GUEST, unregistred user!
首先在菜单“Component->Import ActiveX Control...”中添加名为Real Player ActiveX Control Library(Version 1.0)的ActiveX控件。然后在Form上放置VCl面板ActiveX下新增加的RealAudio控件,又放置了OpenDialog、MainMenu控件各一个。建立File主菜单及一个子菜单OPen:用于打开.rm文件。在Open中添加代码
如下:
procedure TForm1.Open1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
begin
RealAudio1.FileName:=OpenDialog1.FileName;
RealAudio1.Open;
end;
end;
可是在按F9运行时却报错说
RealAudio1.FileName:=OpenDialog1.FileName;这一行
[Error]Unit1.pas(36):Undeclared identifiter:'FileName'
另外还有2个错误:
[Error]Unit1.pas(37):Undeclared identifiter:'Open'
[Fatal Error]Project1.dpr(5):Could not compile used unit 'Unit1.pas'
全部程序代码如下:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
OleCtrls, RealAudioObjects_TLB, Menus;
type
TForm1 = class(TForm)
RealAudio1: TRealAudio;
MainMenu1: TMainMenu;
OpenDialog1: TOpenDialog;
N1: TMenuItem;
Open1: TMenuItem;
Exit1: TMenuItem;
procedure Open1Click(Sender: TObject);
procedure Exit1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Open1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
begin
RealAudio1.FileName:=OpenDialog1.FileName;
RealAudio1.Open;
end;
end;
procedure TForm1.Exit1Click(Sender: TObject);
begin
Application.terminate;
end;
end.
请问我该如何处理?
谢谢
如下:
procedure TForm1.Open1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
begin
RealAudio1.FileName:=OpenDialog1.FileName;
RealAudio1.Open;
end;
end;
可是在按F9运行时却报错说
RealAudio1.FileName:=OpenDialog1.FileName;这一行
[Error]Unit1.pas(36):Undeclared identifiter:'FileName'
另外还有2个错误:
[Error]Unit1.pas(37):Undeclared identifiter:'Open'
[Fatal Error]Project1.dpr(5):Could not compile used unit 'Unit1.pas'
全部程序代码如下:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
OleCtrls, RealAudioObjects_TLB, Menus;
type
TForm1 = class(TForm)
RealAudio1: TRealAudio;
MainMenu1: TMainMenu;
OpenDialog1: TOpenDialog;
N1: TMenuItem;
Open1: TMenuItem;
Exit1: TMenuItem;
procedure Open1Click(Sender: TObject);
procedure Exit1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Open1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
begin
RealAudio1.FileName:=OpenDialog1.FileName;
RealAudio1.Open;
end;
end;
procedure TForm1.Exit1Click(Sender: TObject);
begin
Application.terminate;
end;
end.
请问我该如何处理?
谢谢