473,498 Members | 2,058 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IWMPPlayer4 /MediaPlayerClass

i m making a toolbar with radio feature in C#,and i m supposed to use above
mention interface/class but i have problem in both, i m
using this code for interface, but dont know how to initialize that it gives
object reference is not instance of object.

WMPLib.IWMPPlayer4 player1=null; //what to assign there ?
player1.enableContextMenu = false;
player1.URL= "url.asx";
player1.controls.play(); if error from first line is removed then it
will work.
///second code.
MediaPlayer.MediaPlayerClass clas = new MediaPlayerClass();
clas.BaseURL= "url.asx";
clas.Play(); //exception in this line CTL_E_ILLEGALFUNCTION CALL ? how to
remove that there is not function to remove that.
plz i know activx controll is there but the problem is that i m using that
in toolbar i m unable to port activex controll on toolbar.

Aug 25 '07 #1
1 3348
tasleem,

If you have the ActiveX control imported through interop, then you
should be able to call the GetOCX method on the control, and then cast it to
your interface.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"tasleem" <ta*****@discussions.microsoft.comwrote in message
news:FA**********************************@microsof t.com...
>i m making a toolbar with radio feature in C#,and i m supposed to use above
mention interface/class but i have problem in both, i m
using this code for interface, but dont know how to initialize that it
gives
object reference is not instance of object.

WMPLib.IWMPPlayer4 player1=null; //what to assign there ?
player1.enableContextMenu = false;
player1.URL= "url.asx";
player1.controls.play(); if error from first line is removed then
it
will work.
///second code.
MediaPlayer.MediaPlayerClass clas = new MediaPlayerClass();
clas.BaseURL= "url.asx";
clas.Play(); //exception in this line CTL_E_ILLEGALFUNCTION CALL ? how
to
remove that there is not function to remove that.
plz i know activx controll is there but the problem is that i m using that
in toolbar i m unable to port activex controll on toolbar.

Aug 27 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2499
by: Jeffery Franzen | last post by:
Anyone know where the documentation is regarding Activex controls in asp web forms? I'm using VS.NET 2002 enterprise and am trying to use Activex controls in vb.net web form app. I do the add...
0
7121
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6993
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7162
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6881
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7375
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5456
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4584
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.