IWMPPlayer4 /MediaPlayerClass

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top