Error The type or namespace name "AxWMPLib" could not be found (are you missing the using directive or assembly references?)

What is the possible reference for the handler AxWMPLib._WMPOCXEvents_PlayStateChangeEventHandler?

When I pass this event in a method,

private void axWindowsMediaPlayer1_PlayStateChange(object sender,AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e)

Compilation produces the following error:

Cannot find type name or namespace 'AxWMPLib' (are you missing the using directive or assembly references?)

+4
source share
1 answer

If you are using Visual Studio, make sure that you have the AxWMPLibone specified in the Links section in Solution Explorer. If you have a built-in Windows Media Player control in the form, it should be added automatically along with WMPLib.

, , Windows Media ( ). " ..." , "Windows Media Player" " COM" "". Windows Media Player, ; , . AxWMPLib WMPLib . Windows Media, , .

+2

All Articles