WMP - Source object doesn't provide IPropertyNotifySink

446 views Asked by At

I've included a reference to the WMP according to this instruction: https://msdn.microsoft.com/de-de/library/windows/desktop/dd564585(v=vs.85).aspx

The form designer's code looks like this:

    <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

I'm now getting the error "System.ArgumentException: The source object doesn't provide the IPropertyNotifySink event interface." in the line

CType(Me.wmp1, System.ComponentModel.ISupportInitialize).EndInit()

I don't have any idea what I should do here. Can anybody help?

1

There are 1 answers

0
tmighty On