procedure TForm1.N2Click(Sender: TObject);
var
mfile:string;
begin
opendialog1.Execute;
mfile:=string(opendialog1.FileName );
showmessage(mfile);
MCISendString('open'+mfile, 0, 0, 0);
//如果有绝对路径如'open c:\1.mp3'就可以,但是现在用字符串来替代路径就不行了,请问出错在哪里呢?
MCISendString('PLAY'+mfile, 0, 0, 0); //同上
MCISendString('Close'+mfile, 0, 0, 0); //同上
end;
var
mfile:string;
begin
opendialog1.Execute;
mfile:=string(opendialog1.FileName );
showmessage(mfile);
MCISendString('open'+mfile, 0, 0, 0);
//如果有绝对路径如'open c:\1.mp3'就可以,但是现在用字符串来替代路径就不行了,请问出错在哪里呢?
MCISendString('PLAY'+mfile, 0, 0, 0); //同上
MCISendString('Close'+mfile, 0, 0, 0); //同上
end;
MCIERROR mciSendString(
LPCTSTR lpszCommand,
LPTSTR lpszReturnString,
UINT cchReturn,
HANDLE hwndCallback
);
或
pchar('open '+mfile )