my code:
private AxWMPLib.AxWindowsMediaPlayer axWindowsMediaPlayer1;
this.axWindowsMediaPlayer1
= new AxWMPLib.AxWindowsMediaPlayer();
((System.ComponentModel.ISupportInitialize)(this.axWindowsMediaPlayer1)).BeginInit();
this.SuspendLayout();
//
//
axWindowsMediaPlayer1
//
axWindowsMediaPlayer1.Dock = DockStyle.Fill;
this.axWindowsMediaPlayer1.Enabled = true;
this.axWindowsMediaPlayer1.Location = new System.Drawing.Point(112, 88);
this.axWindowsMediaPlayer1.Name = "axWindowsMediaPlayer1";
this.axWindowsMediaPlayer1.OcxState =
((System.Windows.Forms.AxHost.State)(Resources.ResourceManager.GetObject("axWindowsMediaPlayer1.OcxState")));
//this.axWindowsMediaPlayer1.Size = new System.Drawing.Size(384, 248);
this.axWindowsMediaPlayer1.TabIndex = 0;
axWindowsMediaPlayer1.URL = url; //here url contain file location
axWindowsMediaPlayer1.Ctlcontrols.play();
when i
run this program it show me error that getobject method is not a part
of resources.resourcemanager namespace
Loading
tarun kumarPosted Mar 11, 2010, 6:43 AM
this.axWindowMediaPlayer1 is not a type
so i replaced it with axwmplib.AxWindoMediaPlayer.
now i am getting run time exception that said.
"Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "AxWMPLib.AxWindowsMediaPlayer.resources" was correctly embedded or linked into assembly "AxInterop.WMPLib" at compile time, or that all the satellite assemblies required are loadable and fully signed."
now my code is:
this.axWindowsMediaPlayer1 = new AxWMPLib.AxWindowsMediaPlayer();
((System.ComponentModel.ISupportInitialize)(this.axWindowsMediaPlayer1)).BeginInit();
this.SuspendLayout();
//
// axWindowsMediaPlayer1
//
this.axWindowsMediaPlayer1.Dock = DockStyle.Fill;
this.axWindowsMediaPlayer1.Enabled = true;
this.axWindowsMediaPlayer1.Location = new System.Drawing.Point(112, 88);
this.axWindowsMediaPlayer1.Name = "axWindowsMediaPlayer1";
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(AxWMPLib.AxWindowsMediaPlayer));
this.axWindowsMediaPlayer1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axWindowsMediaPlayer1.OcxState")));
//this.axWindowsMediaPlayer1.Size = new System.Drawing.Size(384, 248);
this.axWindowsMediaPlayer1.TabIndex = 0;
axWindowsMediaPlayer1.URL = url;
axWindowsMediaPlayer1.Ctlcontrols.play();
Amit ChoudharyPosted Mar 11, 2010, 6:13 AM
try to create the object of ResourceManager
please mark as answer if it helps.