我原来程序已经运行成功了,我重装系统,delphi重装的以后这断代码提示错误,我不记得是不是少装了什么,就是打开文件的地方提示错误,求大神解一下,小弟刚学,代码如下;
unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ComCtrls;type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    procedure FormCreate(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;implementation{$R *.dfm}
uses Bass;
var
  hs : HSTREAM;       
  time : Double;      
procedure TForm1.Button1Click(Sender: TObject);                      
begin
  BASS_ChannelPlay(hs, False); 
end;procedure TForm1.Button2Click(Sender: TObject);
begin
  BASS_ChannelStop(hs);                         
end;procedure TForm1.Button3Click(Sender: TObject);
begin
  BASS_ChannelPause(hs);                        
end;procedure TForm1.Button4Click(Sender: TObject);
var
  Mp3Path : AnsiString;
begin
  OpenDialog1.Filter := 'Mp3 文件(*.mp3)|*.mp3|Wav 文件(*.wav)|*wav';                                             //OpenDialog1.Filter提示有错吴   
  if OpenDialog1.Execute then
    Mp3Path := AnsiString(OpenDialog1.FileName);  //括号里面提示错误  BASS_StreamFree(hs);                                   hs := BASS_StreamCreateFile(False, PAnsiChar(Mp3Path), 0, 0, 0);       if hs < BASS_ERROR_ENDED then                              
    Text := '打开失败'
  else
    Text := string(Mp3Path);
end;procedure TForm1.FormCreate(Sender: TObject);                          
begin
  if HiWord(BASS_GetVersion) <> BASSVERSION then
    MessageBox(0, '"Bass.dll" 文件版本不合适! ', nil, MB_ICONERROR);
  if not BASS_Init(-1, 44100, 0, 0, nil) then
    ShowMessage('初始化错误');
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
  BASS_Free;                                      
end;end.

解决方案 »

  1.   

    这些BASS_开头的函数在哪定义的。没看到有定义啊。
      

  2.   

    窗体上放一个TOpenDialog控件, 命名为OpenDialog1
      

  3.   

    [DCC Error] Unit1.pas(57): E2003 Undeclared identifier: 'OpenDialog1'
    [DCC Error] Unit1.pas(57): E2066 Missing operator or semicolon
    [DCC Error] Unit1.pas(58): E2029 'THEN' expected but identifier 'Execute' found
    [DCC Fatal Error] Project1.dpr(5): F2063 Could not compile used unit 'Unit1.pas'
      

  4.   

    2楼已经说了,OpenDialog控件没有