S
scansoft
Unregistered / Unconfirmed
GUEST, unregistred user!
我做WindowsMediaPlayer1的播放列表,一运行到
currPlayList := WindowsMediaPlayer1.newPlaylist('音乐','');
就报错Access violation at address FF0875FF
跟进去看了下,运行到
function TWindowsMediaPlayer.newPlaylist(const bstrName: WideString; const bstrURL: WideString): IWMPPlaylist;
begin
Result := DefaultInterface.newPlaylist(bstrName, bstrURL);
end;
function TWindowsMediaPlayer.GetControlInterface: IWMPPlayer4;
begin
CreateControl;
Result := FIntf;
end;
procedure TWindowsMediaPlayer.CreateControl;
procedure DoCreate;
begin
FIntf := IUnknown(OleObject) as IWMPPlayer4;
end;
begin
if FIntf = nil then DoCreate;
end;
function TWindowsMediaPlayer.GetControlInterface: IWMPPlayer4;
begin
CreateControl;
Result := FIntf;
end;
就是这个end;这报错.
程序代码如下:
var
i : integer;
NewMedia: IWMPMedia;
currPlayList: IWMPPlaylist;
begin
WindowsMediaPlayer1.close;
WindowsMediaPlayer1.currentPlaylist.clear;
currPlayList := WindowsMediaPlayer1.newPlaylist('音乐','');
WindowsMediaPlayer1.currentPlaylist := currPlayList;
NewMedia := WindowsMediaPlayer1.newMedia('C:/test1.map');
NewMedia := WindowsMediaPlayer1.newMedia('C:/test2.map');
NewMedia := WindowsMediaPlayer1.newMedia('C:/test3.map');
NewMedia := WindowsMediaPlayer1.newMedia('C:/test4.map');
NewMedia := WindowsMediaPlayer1.newMedia('C:/test5.map');
WindowsMediaPlayer1.currentPlayList.appendItem(NewMedia);
WindowsMediaPlayer1.currentMedia := newMedia;
WindowsMediaPlayer1.controls.play;
end;
帮忙看看啊!
currPlayList := WindowsMediaPlayer1.newPlaylist('音乐','');
就报错Access violation at address FF0875FF
跟进去看了下,运行到
function TWindowsMediaPlayer.newPlaylist(const bstrName: WideString; const bstrURL: WideString): IWMPPlaylist;
begin
Result := DefaultInterface.newPlaylist(bstrName, bstrURL);
end;
function TWindowsMediaPlayer.GetControlInterface: IWMPPlayer4;
begin
CreateControl;
Result := FIntf;
end;
procedure TWindowsMediaPlayer.CreateControl;
procedure DoCreate;
begin
FIntf := IUnknown(OleObject) as IWMPPlayer4;
end;
begin
if FIntf = nil then DoCreate;
end;
function TWindowsMediaPlayer.GetControlInterface: IWMPPlayer4;
begin
CreateControl;
Result := FIntf;
end;
就是这个end;这报错.
程序代码如下:
var
i : integer;
NewMedia: IWMPMedia;
currPlayList: IWMPPlaylist;
begin
WindowsMediaPlayer1.close;
WindowsMediaPlayer1.currentPlaylist.clear;
currPlayList := WindowsMediaPlayer1.newPlaylist('音乐','');
WindowsMediaPlayer1.currentPlaylist := currPlayList;
NewMedia := WindowsMediaPlayer1.newMedia('C:/test1.map');
NewMedia := WindowsMediaPlayer1.newMedia('C:/test2.map');
NewMedia := WindowsMediaPlayer1.newMedia('C:/test3.map');
NewMedia := WindowsMediaPlayer1.newMedia('C:/test4.map');
NewMedia := WindowsMediaPlayer1.newMedia('C:/test5.map');
WindowsMediaPlayer1.currentPlayList.appendItem(NewMedia);
WindowsMediaPlayer1.currentMedia := newMedia;
WindowsMediaPlayer1.controls.play;
end;
帮忙看看啊!