我根据此说明包括了对WMP的引用:https://msdn.microsoft.com/de-de/library/windows/desktop/dd564585(v = vs.85).aspx
表单设计师的代码看起来像这样:
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmMP))
Me.wmp1 = New AxWMPLib.AxWindowsMediaPlayer()
CType(Me.wmp1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'wmp1
'
Me.wmp1.Enabled = True
Me.wmp1.Location = New System.Drawing.Point(67, 51)
Me.wmp1.Name = "wmp1"
Me.wmp1.OcxState = CType(resources.GetObject("wmp1.OcxState"), System.Windows.Forms.AxHost.State)
Me.wmp1.Size = New System.Drawing.Size(75, 23)
Me.wmp1.TabIndex = 0
'
'frmMP
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(284, 261)
Me.Controls.Add(Me.wmp1)
Me.Name = "frmMP"
Me.Text = "frmMP"
CType(Me.wmp1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
我现在得到错误" system.argumentException:源对象不提供iPropertynotifysink事件接口。"在行中
CType(Me.wmp1, System.ComponentModel.ISupportInitialize).EndInit()
我不知道我应该在这里做什么。有人可以帮助吗?
我在这里找到答案:https://tutel.me/c/programming/questions/39126371/systemargumentException inputting axkwmplibaxwindowsmediaplayer in form
原始答案器是@hanspassant