奇怪的问题,这是怎么回事?高手帮忙啊! ( 积分: 10 )

  • 主题发起人 主题发起人 scansoft
  • 开始时间 开始时间
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;
帮忙看看啊!
 
控件问题
 
接受答案了.
 
后退
顶部